See the title for the approx. cause.
In the log I get a PHP notice:
Notice: Undefined index: entity_from_field:field_image-node-file in ctools_entity_from_field_get_child() (line 22 of /home/xxx/public_html/xxx/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc).
and an EntityMalformedException:
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7389 of /home/xxx/public_html/xxx/includes/common.inc).
Seeing as the notice mentions ctools I thought I'd check in here as I'm not having a whole lot of luck elsewhere. I understand that the second message is likely linked to http://drupal.org/node/1277376#comment-5041700 but that thread seems to point the finger at contrib modules generally and I'm having no joy isolating what module might be causing this problem.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | ctools-empty_context-1292098-13.patch | 807 bytes | mikeker |
Comments
Comment #1
dddbbb commentedI'm also getting the first error (only it's on line 24) but I'm not even trying to create anything - just viewing already created content.
Comment #2
tomogden commentedFor me this error only ever occurs at the /user page, after I have logged in. And yes, it is on line 24 now.
Comment #3
merlinofchaos commentedHmm. A relationship on a broken entity perhaps. The relationship code may need to validate source data better.
Comment #4
Funksmaname commentedI had exactly the same issue after deleting a content type that was being referenced by page variants. I think they were set to validate the content type before issuing a page redirect - deleting all varients that had anything to do with the deleted content type got rid of the error.
Hope this helps!
Comment #5
szantog commentedI think this is not a bug. You have to make sure the context is exists, before using.
An example:
Content type foo contains an entity reference field to the content type bar. Content type bar contains a check_it checkbox.
You set up a relationship from the entity reference field to the content type bar. Add a visibility rule to a pane, based on field: Node bar: check_it Add the relationship to this rule.
Then if you see a foo type content, everything will be fine. Then visit a bar type content, you will get the same, as in the issue summary.
The solution is, add a visibility rule Context exists, before the visibility rule of field value checking. You can add the context checking to the access settings also.
But you are right, it would be better, if the missing relationship would be skipped automatically.
Comment #6
merlinofchaos commentedNo, I think it is a bug; the content type shouldn't produce warnings because it saw an empty context. Empty contexts are valid input, and since they are empty they should simply have no output.
Most content types check for empty data, so we just need to make sure that the content type that is putting out this error is appropriately sanity-checking all data it uses.
Comment #7
mikeker commentedCan we fail the access check if the context doesn't exist? (see attached)
My project had some complicated visibility rules that didn't allow me to put a Context Exists check before checking the value of an entity ref.
Comment #8
tgeller commentedI applied the patch and the error disappeared from my site. (I can't confirm anything else about it.) Ready to go?
Comment #9
japerryTested, fixed, and committed:
http://drupalcode.org/project/ctools.git/commit/a6dcb8f2e2f2edc6b3b21bf4...
Comment #11
szt commentedSame notice, with the latest dev...
In addition every page gives WSOD, except admin pages with admin theme.
I've just added some relationship and contextual filter to a view...
Comment #12
Yuri commentedI confirm that this error message still appears using the latest dev of ctools. Adding a panel pane is impossible, each time when trying to add a panel pane, ajax error 500 comes up, with this error message in the log. It makes my site unusable as an admin, thus I see this as a major issue.
Comment #13
mikeker commentedKeep in mind that a given error on a given line can be caused by many different situations. This issue was limited to empty Panels contexts causing errors when used in access plugins and the solution is very specific to this situation. I've been running with this patch for a year without seeing any of the issues mentioned in #11 and #12.
I think you'll get better traction if you open a new issue with the specifics of your situation. Including an export of a View/Panels that will reproduce the error is also very helpful.
Comment #14
aaronbaumanszt, Yuri, did you open a new issue?