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.
If the user doesn't have the "administer nodes" permission, the expire field is place randomly on the node edit form. I suggest we create our own $form['options'] if one doesn't exist, this way we'll stay consistent regardless of the users permissions.
As well as support other modules that expose a more granular permissions for the node publishing options, such as Override Node Options module.
Comment | File | Size | Author |
---|---|---|---|
#2 | node_expire_form_options_regardless_of_permissions_2326187-2.patch | 954 bytes | droath |
Comments
Comment #1
droath CreditAttribution: droath commentedComment #2
droath CreditAttribution: droath commentedComment #3
droath CreditAttribution: droath commentedComment #5
Nafes CreditAttribution: Nafes commentedThe changes have been placed to 7.x-1.x-dev release. Thank you droath!
Comment #6
Nafes CreditAttribution: Nafes commentedTested and added to the recommended release 7.x-1.6.
Comment #7
stewart.adam CreditAttribution: stewart.adam commentedNote this patch may not behave as described in the original post; when users do not have the necessary permissions,
$form['options']
still is set, just that$form['options']['#access'] = FALSE
. This patch checks for if$form['options']
is set so under this circumstance the node expire is not added to the form at all.Comment #8
Nafes CreditAttribution: Nafes commentedComment #10
Nafes CreditAttribution: Nafes commentedStewart, you are right. Thank you for the note.
I made some corrections and placed them to 7.x-1.x-dev release. Does this look better? Or version without the patch is preferable?
Comment #11
Nafes CreditAttribution: Nafes commentedChanges have been added to the recommended release 7.x-1.7. The code piece after changes is below.