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!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

itaine’s picture

I 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.

jared_sprague’s picture

thanks 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.

Jorrit’s picture

Status: Active » Needs review

Let's put this on Needs Review so people know there is a patch attach to this issue.

Gold’s picture

Status: Needs review » Reviewed & tested by the community

"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.

pandaski’s picture

Version: 7.x-1.4 » 7.x-2.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
Issue tags: +7.x-2.1
FileSize
453 bytes

Here should be a version that applies to 7.x-2.0. Meanwhile I also committed this to 7.x-2.x.

  • Joseph Zhao committed cff0faf on 7.x-2.x
    Issue #1765914 by jared_sprague, itaine, Joseph Zhao: Typo on line 557...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.