The above notice appears when trying to assign or pull data / values from undefined arrays cells.
This can be checked before trying the assignment.
Example for code that gives an error:
1 2 3 4 5 6 |
<?php $image = $node->field_image['und'][0]['filename']; if (isset($image)) { print '<img src="/sites/default/files/'.$image.'" />'; } ?> |
Example of checking correctly to avoid the notice:
1 2 3 4 5 6 |
<?php $image = $node->field_image; if (isset($image['und'][0]['filename'])) { print '<img src="/sites/default/files/'.$image['und'][0]['filename'].'" />'; } ?> |