Hello,
I have this error on node edit page and when node has an entity reference fields.
So I created a patch. Please review it.

Comments

paravibe’s picture

Status: Active » Needs review
StatusFileSize
new602 bytes
bleen’s picture

can you paste in the exact error you are getting?

paravibe’s picture

Yes, please:
Notice: Trying to get property of non-object in entity_metadata_no_hook_node_access() (line 615 of sites\all\modules\contrib\entity\modules\callbacks.inc).

EWB’s picture

I am getting this as well. The patch in #1 worked.

This notice occurred immediately after upgrading to 7.x-1.0 (from 7.x-1.0-rc3 ) and presents (as drupalrv noted) when editing a node that has entity reference fields.

Notice: Trying to get property of non-object in entity_metadata_no_hook_node_access() (line 615 of /Applications/sites/all/modules/contrib/entity/modules/callbacks.inc).

JvE’s picture

Status: Needs review » Closed (duplicate)
bkmatwa’s picture

I was getting the same error as 'drupalrv' and 'EWB' was getting when I was adding videos to a new node via the Brightcove Integration module/API (version 7.x-3.4). Tried applying the patch, but now my Brightcove API doesn't work. Any suggestions to get these two to play together nicely?

valderama’s picture

Patch in #1 worked for me.

I have a brightcove field on another content-type, where I do not have an entity-reference field - and even after applying the patch I still browse and add brightcove videos. @bkmatwa - what are your exact problems with the brightcove API after you applied the patch?

Anonymous’s picture

Just had same issue and #1 worked for me too. I have two content types, artist and photocard. I'm using corresponding entity reference in order to use views_field_view so I can pass through artist nid to a view of photocards which I embed in the view.

hth

stevieb’s picture

patch #1 worked here too

paravibe’s picture

Status: Closed (duplicate) » Needs review
JvE’s picture

johnlaine’s picture

Status: Needs review » Closed (duplicate)

I was getting this error on node creation page when node had an entity reference field and also using the "Inline Entity Form" to create the referenced entity.
#1 patch worked perfectly, Thanks!

mrcniceguy’s picture

The Trick in Patch #1 worked in my Custom module, Thankx.

ladybug_3777’s picture

Patch in #1 worked for me, but seeing the duplicate patch discussion page makes me wonder if I've picked the correct fix or not.

So far no issues with the patch that I can see though.....

tseven’s picture

Thank you drupalrv for the Patch in #1, it worked for me as well.
When can we expect this to be merged?

alexkb’s picture

For those wondering: as #1780646: entity_access() fails to check node type specific create access has been committed and rolled into the v1.3 release of entity api, this patch appears to be no longer needed. Since updating to v1.3, I can't seem to reproduce the error anymore.