Hello,

I am using the latest files from 7.x-dev and it appears that because of a sudden change in the files (i couldn't find any specific one) i've started to recieve warnings in my front page which is default node listing of drupal.

The error message is;

Notice: Undefined offset: 188 in _field_invoke_multiple() (line 351 of /home/..../modules/field/field.attach.inc).

My solution is;

File: field.attach
Line: 351
Change:
if ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode])) {

To:
if (isset($grouped_items[$field_id][$langcode][$id]) && ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode]))) {

I believe the error is because of empty arrays.

Waiting feedback and comment on this.

Thanks

CommentFileSizeAuthor
#1 1164240.patch1.28 KBdroplet

Comments

droplet’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
Issue tags: +Needs backport to D7
StatusFileSize
new1.28 KB

do empty() check on empty array().

same patch working on D7&8

Status: Needs review » Needs work

The last submitted patch, 1164240.patch, failed testing.

droplet’s picture