Closed (fixed)
Project:
Organic Groups
Version:
7.x-1.2
Component:
og.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2011 at 08:59 UTC
Updated:
11 Nov 2011 at 22:30 UTC
After I upgraded OG from 7.1.1 to 7.1.2 I get this error when I try to clear my cache.
WD menu: EntityMalformedException: Missing bundle property on entity of type node. in [error]
entity_extract_ids() (line 7405 of
/var/www/***/includes/common.inc).
Any suggestions how to fix this?
Comments
Comment #1
medden commentedIn case anyone else gets this. I solved the error by disabling the og_field_access module, which I didn't really need anyway.
Comment #2
amitaibuComment #3
jdlind38 commentedI also experienced this error and disabled the og_field_access module before I performed the update to 7.1.2. I also have the Field Permissions module (7.x-1.0-beta1) installed, could there be a conflict?
Comment #4
medden commentedI do have latest entity API and I did run update.php and clear caches.
The error comes back if I re-enable og_field_access module- so I'm guessing it's something in there causing the error.
Comment #5
amitaibuI'm trying to reproduce, but can't see so far the problem. Can anyone share the steps to reproduce?
Comment #6
ishadakota commentedI can't give more information about how to reproduce, but I also had the same issues and the error was occurring under these conditions.
I'll test some more later to see if I can reproduce and be more specific.
Comment #7
amitaibuCan anyone attach here a db dump of your dev. Make sure to disable everything that is not necessary, so it's easy to test it.
Comment #8
othermachines commentedExact same problem here (#6). Updating to critical since anonymous users can't access my site at all.
There seems to be a problem with the implementation of the new $strict argument in og_user_access_entity() (commit d0a49411 Accessing an entity should be less permissive). When an unset $entity is passed into this function from og_field_access_field_access() the error is triggered in entity_extract_ids() before the value of $strict is processed.
To clarify, if we replace the old lines (from 7.x-1.1)...
.. the error goes away.
Hope that helps.
Comment #9
amitaibu> When an unset $entity is passed into this function from og_field_access_field_access()
When do you get an unset $entity - hook_field_access() should get a populated entity.
Comment #10
amitaibure-Setting priority
Comment #11
andrés chandía commentedSame problem, I enable the og_field_access module, and do log out, I get this:
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7405 of .../includes/common.inc). I have Entity API 7.x-1.0-beta11
I'm also experiencing the problem described here: http://drupal.org/node/1321028
Comment #12
othermachines commentedCorrection: Only superadmin doesn't get the error, which makes sense because of the check for $user->uid == 1 at the top of og_user_access_entity().
$entity is an optional argument in hook_field_access, is it not?
Here's a snippet of my backtrace, if it helps:
The field that's being checked:
Comment #13
amitaibuSorry, a human can't read this backtrace :)
> $entity is an optional argument in hook_field_access, is it not?
Not -- http://api.drupal.org/api/drupal/modules--field--field.api.php/function/...
Apart of OG and OG field access what other contrib modules to you have installed?
Comment #14
othermachines commentedContrib:
admin
colorbox
context
context_og
context_ui
ctools
devel
devel_node_access
diff
entity
features
file_entity
file_styles
libraries
link
media
media_internet
media_youtube
og
og_access
og_context
og_field_access
og_ui
og_node_link
og_theme
og_create_perms
og_views
page_manager
panels
pathauto
strongarm
styles
styles_ui
token
views
views_content
views_slideshow
views_slideshow_cycle
views_ui
wysiwyg
Comment #15
amitaibuPlease replace, for debugging, in og_field_access module this function, and attach a screenshot of your findings (make sure devel is enabled and all users have devel permissions enabled)
Comment #16
andrés chandía commentedadmin_language/ ctools/ i18nviews/ link/ og_create_perms/ pathauto/ translation_overview/
admin_menu/ demo/ l10n_client/ module_filter/ transliteration/
advanced_help/ entity/ l10n_update/ nice_menus/ og_subgroups/ smtp/ variable/
captcha/ extlink/ languageicons/ noggin/ og_theme/ superfish/ views/
ckeditor/ i18n/ libraries/ og/ panels/ token/ views_slideshow/
Comment #17
amitaibu@othermachines,
It seems that Views is calling the field access -- please disable the view on the page you look, and confirm this is the case.
Comment #18
amitaibuOk, I see the problem. Views, is calling field_access() without an entity, which turns out to be indeed optional. Will commit a fix soon.
Comment #19
amitaibuPlease get latest -dev from GIT, or wait a few hours to download, and confirm fix -- http://drupalcode.org/project/og.git/commitdiff/310d349
If fixed, I'll (sadly) roll a new version
Comment #20
othermachines commentedThat's good news to arrive home to. Fix works for me. Thx, Amitaibu -
Comment #21
andrés chandía commentedPerfectly working, even modules "OG create permissions", "Organic groups subgroups", "OG subgroups views integration" are working charmly.
Comment #22
amitaibu7.x-1.3 will soon be public -- http://drupal.org/node/1324936
Comment #23
andrés chandía commentedNow when I create any content as no admin user I get this warning, but the content is created anyway:
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of .../includes/entity.inc).
This warning appears at the moment I select any kind of content to create.
Comment #24
amitaibu@ Andrés Chandía,
Please disable everything not related to OG and try again.
Comment #25
RobKoberg commentedJust upgraded and hit this issue. And just as I figured out it was with og_field_access the fix comes out! Thanks for the fast action Amitai!
Comment #26
andrés chandía commentedDo you mean all the modules in the site or those at the OG wich do not come with OG core?, like "OG create permissions"
Comment #27
amitaibufyi, #1325378: When checking entity access, return early if entity isn't saved yet
Comment #28
amitaibuI've added tests to #1325378: When checking entity access, return early if entity isn't saved yet . I'll appreciate people getting latest -dev and confirming everything in (finally) fixed :/
Comment #29
othermachines commentedConfirmed #23 fixed.