Activating a content lock programatically.

Created on 12 December 2016, over 8 years ago
Updated 11 June 2025, about 2 months ago

I have a module that creates a node (After prefilling data) and then using drupal redirect it drops the user into the node/edit. Content lock cannot seem tolock the newly created node automatically. Is there a way to lock the new node automatically so as to protect it? Users generally won't click the manual lock message which makes it tricky, so I'd like to have them locked immediately regardless.

πŸ’¬ Support request
Status

Closed: works as designed

Version

2.1

Component

Miscellaneous

Created by

πŸ‡¨πŸ‡¦Canada mikeohara Moncton, NB

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    On the latest version if you go to the edit form for an existing node it will be locked. If the prefilling only takes place on the form level and the node does not actually exist yet it cannot be locked.

Production build 0.71.5 2024