I know this isn't necessarily views accordian related, but I only get this when trying to enable it.

function field_language($entity_type, $entity, $field_name = NULL, $langcode = NULL) {
  $display_languages = &drupal_static(__FUNCTION__, array());
  list($id, , $bundle) = entity_extract_ids($entity_type, $entity);
  $langcode = field_valid_language($langcode, FALSE);

  if (!isset($display_languages[$entity_type][$id][$langcode])) {
    $display_language = array();

    // By default display language is set to LANGUAGE_NONE if the field
    // translation is not available. It is up to translation handlers to
    // implement language fallback rules.
    foreach (field_info_instances($entity_type, $bundle) as $instance) {
      $display_language[$instance['field_name']] = isset($entity->{$instance['field_name']}[$langcode]) ? $langcode : LANGUAGE_NONE;    ////THIS LINE IS REPORTED AS THE ERROR
    }

I would think isset would check to see if it was not null, so there must be something else at play here.

Comments

kreynen’s picture

I get this error at the bottom of every page after enabling CiviCRM. Disabling CiviCRM removed the error so I think it is an issue with the way these modules are implementing Views, but I haven't done any troubleshooting beyond that.

rickmanelius’s picture

@kreynen.
I wish I only got it at the bottom of my screen. I get the WSOD!

rickmanelius’s picture

Also, I was able to recreate this on another, vanilla installation using the latest dev modules across the board.
Using Drupal 7.2. I haven't found a patch for this yet.

kreynen’s picture

@rickmanelius I think see the error vs. the WSOD is because of your web server's error settings. This error is really frustrating because when I Google this error I find dozens of Drupal sites that likely had the error on the site when Google last indexed it, but the majority of theme have either uninstalled the module that caused the error or found a fix.

http://www.google.com/search?q=Fatal+error%3A+Cannot+access+empty+proper...

rickmanelius’s picture

@kreynen. Thanks for the reply! What module was causing the trouble for you? I can't rightly remove the field module as it pretty much runs my entire site!

What's weird is I'm having the same error on 2 different servers with different apache configuations altogether. So I'll have to track this down a bit more. Thanks for the tips.

kreynen’s picture

@rickmanelius hope this helps. I don't think this has anything to do with Views Accordian.

I spent an hour chasing this error around I realized that civicrm was a red herring. The site I was working with was recently upgraded from D6 to D7. I can't explain why enabling civicrm triggered the error, but the error itself had to do with an empty entity record created by a node with no node_revision in this case. Finding the corrupt node and deleting it solved the problem for me...

http://drupal.org/node/1028230#comment-4234644

If you set..

$display_language[$instance['field_name']] = LANGUAGE_NONE;

the error just moves to field.attach.inc. If you enable Locale, it moves up to that module... but always the same type of reference to and empty entity.

Good luck!

rickmanelius’s picture

@kreynen
Thanks so much for the sleuthing. Honestly, I do appreciate it.

Interestingly enough, this site also was a D6 to D7 upgrade. So that might be a potential source. Something is not getting fully ported properly...

I'll test on a fresh D7 install and see if I can get around this.

Tomyris’s picture

I'm having the same error on an all but fresh Drupal 7 install. All I've done so far is some sandboxing with various modules, and I never saw the error until I tried to use Views Accordion. When I try to visit my Views Accordion page, i get WSOD with

Fatal error: Cannot access empty property in /modules/field/field.multilingual.inc on line 275

Visiting other pages returns these errors instead

Notice: Undefined index: 11 in views_plugin_row_node_view->render() (line 99 of /sites/all/modules/views/modules/node/views_plugin_row_node_view.inc).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 370 of /modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1360 of /modules/node/node.module).
Notice: Undefined property: stdClass::$type in entity_extract_ids() (line 7368 of /includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: 11 in views_plugin_row_node_view->render() (line 99 of /sites/all/modules/views/modules/node/views_plugin_row_node_view.inc).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 370 of /modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1360 of /modules/node/node.module).
Notice: Undefined property: stdClass::$type in entity_extract_ids() (line 7368 of /includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: 11 in views_plugin_row_node_view->render() (line 99 of /sites/all/modules/views/modules/node/views_plugin_row_node_view.inc).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 370 of /modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1360 of /modules/node/node.module).
Notice: Undefined property: stdClass::$type in entity_extract_ids() (line 7368 of /includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).

I hope this helps your investigation!

rickmanelius’s picture

Thanks @Tomyris. I'm debugging now. It's definitely something combining views accordian + core... it's just a matter of who's officially responsible for the error (the one passing or the one trying to execute!)

rickmanelius’s picture

It seems like it's an issue with views accordion passing the wrong information in.

field_language has the following syntax

field_language($entity_type, $entity, $field_name = NULL, $langcode = NULL) 

But if you use dpm from devel, you'll find the the entity type is set to node, and the entity is set to the view. When you check the instance, you can see that it's loading node body instance field information.

Passing the view instead of the entity has a second affect. When entity_extract_ids is called, it can't find the bundle. Therefore field_info_instances returns and array of arrays, one for each bundle with the entity type versus the array of field info just for that bundle.

So my diagnosis is that the view is getting passed in instead of the entity. Now where that it happening, I still gotta dig a bit.

rickmanelius’s picture

Actually upon further reflection, this information doesn't look like it's being set anywhere in the plugin itself, so it may be a conflict between the plugin and views itself, not passing along the proper data.

I can be completely wrong here, but that's the best I can find at the moment..

drichardson23’s picture

Hi,

I get the same error (Drupal 7.2), not sure if it's Views Accordion related (as I don't have that module installed).

At the bottom of each page:

Fatal error: Cannot access empty property in /home/mysite/public_html/modules/field/field.multilingual.inc on line 275

In the logs:

Notice: Undefined index: field_name in field_language() (line 275 of /home/mysite/public_html/modules/field/field.multilingual.inc).

WSOD when trying to run cron, but luckily on no other pages. Haven't found a fix yet. Looks similar to this: http://drupal.org/node/1015580

Cheers.

bachomp’s picture

WSOD When the plugin is activated.

Logs state: Notice: Undefined index: field_name in field_language() (line 275 of /home/mysite/public_html/modules/field/field.multilingual.inc).

Using views_accordion: 7.x-1.x-dev (2011-Jun-26)

cheers

unrev.org’s picture

Not using views accordion here and getting the same error (only in the logs, nothing on the screen) and WSOD when I run cron.

Site's been updated from D6 to D7. Using views but even if I disable views I still get the error.

fuscata’s picture

This is most certainly a core issue. More info here: #1067750: Let Field API fail in a tale-telling way on invalid $entity

tlangston’s picture

subscribing

jenna.tollerson’s picture

I solved this by making sure to set Format->Show to "Fields" and not "Content", which is actually how this module is supposed to work.

Assuming this is a working solution for most, the improvement I would make at this point is to make Views Accordion fail more gracefully, with a nicer error message. :)

rickmanelius’s picture

#17
I'll test this out. But yes. If it's supposed to go to show fields, then this option should be removed when switching to the accordion plugin!

kpojeta’s picture

This worked for me as well. I received the error on d7 (dev versions of all modules) when I chose Accordion style, showing Content. Switching to FIELDS resolved the issue! THANK YOU!

Manuel Garcia’s picture

Status: Active » Fixed

Ive just committed a fix that will prevent this error and inform the user to choose fields.
http://drupal.org/commitlog/commit/8636/0240e1ece7e4bb0718e5aa86765432be...

Thanks guys for all the testing.

Status: Fixed » Closed (fixed)

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