This happens because of a change between 1.7 and 1.8 in modules/callbacks.inc, line 676:
<?php
$op = !empty($node->is_new) && $node->is_new ? 'create' : 'update';
?>When a $node is being created, $node->is_new is not necessarily set, causing $op to become update instead of create.
This used to work in 1.7.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | op_update_should_be_create-2807275-2.patch | 668 bytes | anrikun |
Comments
Comment #2
anrikun commentedHere is a patch.
Comment #3
anrikun commentedComment #4
anrikun commentedComment #5
socialnicheguru commentedthis seems to have worked for me.
Comment #6
webservant316 commentedworks for me.
Comment #7
howdytom commented#2 op_update_should_be_create-2807275-2.patch works for me as well. Thank you.
Comment #8
emmanvazz commented#2 works for me as well. Should be merged into the next version. Thanks!
Comment #9
marc.groth commentedJust confirming that #2 works for me too. Thanks @anrikun.
Hopefully this can be merged soon.
Comment #10
nvakenConfirmed, works here too.
Comment #11
dasginganinjaConfirming that the patch in #2 functions as expected. I no longer experience these error messages.
Comment #12
idflood commentedPatch in #2 fixed the issue on one of our production website.
Comment #13
jstoller#2 works for me too.
Comment #14
polPatch #2 is working.
Comment #15
kumkum29 commented#2 works for me too.
Entity API is a important module on a website. Patch this module is a bad thing...
Do you think include this correction in a next version of Entity Api?
Comment #16
knalstaaf commentedComment #17
jason_purdy commentedThis patch works for me, too.
Comment #18
star-szrYes, the patch fixes the notice. Should this bug have an automated test added to try and prevent future regressions?
Comment #19
samt2497 commentedPatch #2 is working for me.
Comment #20
delacosta456 commentedhi on Drupal 7.53 patch 2 tested and applied successfully with both Phpstorm and Patch manager module.
Comment #21
vinmassaro commentedRan into this issue with a node type that just contained a title field and one Paragraphs field. Patch works well, thanks!
Comment #22
jstoller@Cottser: Maybe it's just me, but a test seems like overkill. How about a comment?
Comment #23
fagoSure, good fix. Thanks!
Comment #25
delacosta456 commentedhi
Just for info after applying the patch, in case error still showing please do :
1- drush rr
2- drush cc all
3(once again) drush cc all
and refresh the page
You may not need to do all this in some environment .
..thanks
Comment #27
giupenni commentedWhen in stable version?
Comment #28
pinueve commented+1 #2, i applied patch on 7.x-1.8 v, thanks, also +1 #22, i have a custom access module and #22 also worked fine.
Comment #29
dercheffeIs the patch committed to the stable version already?
Comment #30
sclsweb commenteddercheffe, no -- if I'm interpreting this correctly the current stable release is 7.x-1.8 released 22 September 2016, but the patch wasn't committed until way after that, 8 March 2017.
I would be very appreciative of a new stable release including this patch.
Comment #31
studiozut commentedThe patch works until I reload the page, then the error returns. I cleared drupal cache and drush cache. I'm on Drupal 7.56, Entity API 1.8.
Comment #32
tlwatson+1. This really needs to be in a stable release.
Comment #33
steven jones commentedThis fix is included in Entity 7.x-1.9.