Closed (works as designed)
Project:
Display Suite
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2012 at 07:59 UTC
Updated:
18 Feb 2012 at 20:30 UTC
Hi,
I'm trying to construct a simple if statement in a code field like this:
if ($entity->field_height['und'][0]['value'] != "") {
print t('Height') . ': <strong>[node:field_height] mm</strong>';
}
It is working ok and sentence is printed if height is defined. But if there's no height value it throws me an error:
Notice: Undefined index: und in eval() (line 7 of /var/aegir/platforms/drupal-7.12/sites/all/modules/ds/ds.module(954) : eval()'d code).
I have a multilingual site. What might be the problem here...?
Regards, Mary
Drupal 7.12
PHP 5.3.3-7+squeeze3
PHP memory limit 128M
PHP register globals Disabled
Database system MySQL
Database system version 5.1.49-3
Comments
Comment #1
swentel commentedThat's a PHP error, not an error with DS. You need to check if field_height actually exists or not.
Comment #2
ladyofthelake commentedOf course! This works:
Thanks!