Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After updating to the newest 7.x-3.0-beta 1 version of content_lock, the "Cancel Edit" button on any node edit form causes a PHP Fatal error (and returns a 500 server error).
The error message: PHP Fatal error: Call to undefined function _content_lock_node_form_handler_cancel_submit() in /data/virtual/common/drupal/includes/form.inc on line 1520
.
A content lock still seems to be placed, and can be removed by viewing the node and using the "release the lock" link, but it seems like a fairly major bug.
Note: this occurs using the latest version of Drupal core (7.54).
Comment | File | Size | Author |
---|---|---|---|
#11 | cancel-edit-fix-2852631.patch | 1.22 KB | scotwith1t |
Comments
Comment #2
jaydub CreditAttribution: jaydub commentedSome more details, the undefined function is in the file ./includes/content_lock.node.inc and the only reference to the function is also in that include file as a function passed to #validate array attribute of a form API cancel button:
Given that the new version of Content Lock makes use of a bunch of files in ./includes that are loaded by various module_load_include() calls I would guess that when the form is canceled and the 'validate' handler is run, the module_load_include() pipeline is not or has not been initiated and so the function contained in the include file is not available to PHP.
Comment #4
DevPilot CreditAttribution: DevPilot commentedI moved function _content_lock_node_form_handler_cancel_submit() into the .module file
Now that function is available regardless of include state.
Comment #5
ebarrette CreditAttribution: ebarrette commentedHaving the same issue when clicking the "Cancel Edit" button.
Using Drupal 7.54 and Content Lock version 7.x-3.0-beta1
Comment #6
panshulk CreditAttribution: panshulk at Srijan | A Material+ Company commentedHi
i came across the same issue where on pressing "Cancel Edit" i was facing WSOD (White Screen On Death), the error logs reported the same error mentioned above. Changes in #3 resolved the issue.
It would be great if we can include this change in a release.
Thanks :)
Comment #7
marcelovaniI would recommend the maintainer to create a tag.
The latest tag is not stable as it causes a fatal error without this fix.
Comment #8
jcaprio_nwe CreditAttribution: jcaprio_nwe commentedHaving Same Issue, Drupal 7.56
Content Lock Version: 7.x-3.0-beta1
Comment #9
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedI also fell into the trap today. It would be really nice to tag a release including the commit.
Comment #10
helmo CreditAttribution: helmo at Initfour websolutions commented+1 for a beta2 or full release.
Comment #11
scotwith1tHere's a patch. This is definitely major and has to be fixed in next version please! Thanks!
Comment #12
senortim CreditAttribution: senortim commented+1 that the patch worked fine and for release.
Comment #13
Vacilando CreditAttribution: Vacilando as a volunteer commented+1 the patch is perfectly OK; please make a dev release as soon as possible please. I think this is ready to be set as RTBC as well.
Comment #14
yan CreditAttribution: yan as a volunteer commentedI can confirm, too, that patch from #11 solves the problem.
Comment #15
Amir Simantov CreditAttribution: Amir Simantov commentedPatch #11 worked for me. 7.x-3.0-beta1