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.
In content_lock.api.inc there is a hook defined called:
hook_content_lock_release
However there is a typo on line 557 in content_lock.module:
module_invoke_all('content_lock_released', $nid);
This should be:
module_invoke_all('content_lock_release', $nid);
See attached patch....
Thank you!
Comment | File | Size | Author |
---|---|---|---|
#5 | content_lock-1765914-5-D7-backport-do-not-test.patch | 453 bytes | pandaski |
#1 | content_lock_release_typo_1.patch | 453 bytes | itaine |
content_lock_release_typo.patch | 683 bytes | jared_sprague |
Comments
Comment #1
itaine CreditAttribution: itaine commentedI was hoping this catch would fix the current need to click the 'release the lock' link in the (You may want to 'release the lock' in order to allow others to edit.) message twice before taking effect. But it doesn't, now I think overlay is causing it: separate issue.
Curious, what effect does this typo have or rather what it fixes?
re-rolling patch since the one above didn't apply the change.
Comment #2
jared_sprague CreditAttribution: jared_sprague commentedthanks for re-rolling the patch. This fixed a bug where we were trying to hook hook_content_lock_release in our application, but because of the typo the hook wasn't getting invoked. Fixing this typo means that modules can actually hook this now.
Comment #3
Jorrit CreditAttribution: Jorrit commentedLet's put this on Needs Review so people know there is a patch attach to this issue.
Comment #4
Gold"Curious, what effect does this typo have or rather what it fixes?"
module_invoke_all() allows other modules to have functions execute. So in this case when content_lock_release() is run other modules that invoke HOOK_content_lock_release can also do things.
e.g. I may have a variable on $user that restricts how many pages a user can have locked. In my_user_content_lock_release() in the module my_user I can reduce the count of locked nodes.
I've tested this and the correct hook now fires.
Comment #5
pandaski CreditAttribution: pandaski at XiNG Digital commentedHere should be a version that applies to 7.x-2.0. Meanwhile I also committed this to 7.x-2.x.