Fatal error: Cannot access empty property in ...../modules/field/field.attach.inc on line 314

I was trying to update to the latest dev version by manually deleting the module and reinstalling, (trying to get the calendar working) however i seem to have broken my site now it won't load and comes up with the error above, though i still have admin access ... i'm still a drupal virgin learning as i go so apologies if it's obvious or if im posting in the wrong place. any help/pointers in where i went wrong would be appreciated. Thanks in advance

Comments

JDG85’s picture

Also getting the following error

Notice: Undefined index: in _field_invoke_multiple() (line 299 of ...../modules/field/field.attach.inc).

i have deleted the merci module manually and tried clearing the views cache but still comes up with the same errors and still cant load the main site ... fear i may have broken something in the database and have to start again :(

JDG85’s picture

Seem to have sorted this out

darrick’s picture

Status: Active » Postponed (maintainer needs more info)

What did you end up doing? Did the problem have anything to do with MERCI?

darrick’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
shendric’s picture

Can this be reopened? I have the same problem, and I have no idea how to fix it.

For some reason, every time I create a new item of the content type I created to be managed by MERCI, I get this error whenever I try to view the dashboard that includes the Upcoming Reservations view:

Fatal error: Cannot access empty property in /www/mysite/modules/field/field.attach.inc on line 325

I get the following error, when I go to the Permissions screen:

Notice: Undefined offset: 3 in merci_permissions_form() (line 144 of /www/mysite/modules/merci/modules/merci_permissions/merci_permissions.module).

When I go to Structure, just after creating a new item, I get numerous instances of the following error:

Notice: Undefined index: in _field_invoke_multiple() (line 310 of /mysite/modules/field/field.attach.inc).

shendric’s picture

Status: Closed (cannot reproduce) » Active

Just more data on this issue. I tried updating the core to 7.15, and no change.

also, looking at line 325 in field.attach.inc, I see the following:

$grouped_items[$field_id][$langcode][$id] = isset($entity->{$field_name}[$langcode]) ? $entity->{$field_name}[$langcode] : array();

Is something missing the language code? If so, why do the old ones work, but any new ones of the same type don't?

darrick’s picture

Maybe this issue might have something to do with it: #1565924: Undefined language in MERCI

Can you look in your node table and see if you empty values in the language column?

SELECT * 
FROM  `node` 
WHERE language =  ''

If so try running

UPDATE node SET language='und' WHERE language = ''
shendric’s picture

I had imported my inventory using a script. I emptied out the content and reimported after redoing the script to ensure that a language was chosen. So far, this error has not continued.

darrick’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

earthangelconsulting’s picture

can we please re-open this? or should it be a new issue, since there's no guarantee that the cause is the same, even though the symptom is identical.

i am getting the same error (confirmed, i checked my version of field.attach.inc and it's the same line of code that's failing, ie: the language property that isn't working)

i checked my node table as in #7 above... and note that because we don't know which field is actually giving the error, i also checked the language of all field values from tables starting with field_data_field_merci_ and ALL of them were set to "und", none were empty.

so... similar symptom, possibly different cause?

i am running Drupal core 7.23, have tried both version 7.x-2.0 and 7.x-2.x-dev (from Dec 4, 2013) and the same error is occuring.

earthangelconsulting’s picture

ok i realized this should probably be a new issue. see https://drupal.org/node/2153269