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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

droath’s picture

Issue summary: View changes
droath’s picture

droath’s picture

Status: Active » Needs review

  • Nafes committed a0c1978 on 7.x-1.x authored by droath
    Issue #2326187 by droath: Allowed the expire field to be placed in the...
Nafes’s picture

The changes have been placed to 7.x-1.x-dev release. Thank you droath!

Nafes’s picture

Status: Needs review » Fixed

Tested and added to the recommended release 7.x-1.6.

stewart.adam’s picture

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

Nafes’s picture

Status: Fixed » Needs review

  • Nafes committed f285547 on 7.x-1.x
    Issue #2326187 by Nafes: Made publishing options adjustment.
    
Nafes’s picture

Stewart, 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?

Nafes’s picture

Status: Needs review » Fixed

Changes have been added to the recommended release 7.x-1.7. The code piece after changes is below.

  // If the form doesn't have the publishing options we'll create our own.
  if (!$form['options']['#access']) {
    $form['options1'] = array(
      '#type' => 'fieldset',
      '#title' => t('Publishing options'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
      '#weight' => 95,
    );
    $form['options1']['expire'] = &$expire_field;
  }
  else {
    $form['options']['expire'] = &$expire_field;
  }

Status: Fixed » Closed (fixed)

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