Hello,

I have setup a Drupal site using secure pages to switch to https on any admin page. When editing a box while within the block management index the edit page for the box is incorrect.

the form in the page:

<form action="http://www.example.com/destination%3Dadmin/structure/block" method="post" id="block-admin-configure" accept-charset="UTF-8"><div><div class="form-item form-type-textfield form-item-description">

However the URL should point to: https:// not http://

The current code on 490:

/**
 * Implements hook_form_alter().
 */
function boxes_form_alter(&$form, &$form_state, $form_id) {
  $path = implode('/', array_slice(arg(), 0, 5));
  if (($form_id != 'block_admin_configure' || $path != 'admin/structure/block/manage/boxes') && 
      ($form_id != 'boxes_add_form' || arg(3) != 'box-add')) {
    return;
  }
  
  // Use the Box form submit handler and properly redirect to the correct admin page
  array_unshift($form['#submit'], 'boxes_box_form_submit');
  $form['#action'] = '?destination=admin/structure/block';
  
  // Cancel behavior is different here
  unset($form['cancel']['#attributes']);
  $form['cancel']['#submit'] = array('boxes_block_cancel_submit');
}

If you simply add a "." to line 490 it fixes the issue:

/**
 * Implements hook_form_alter().
 */
function boxes_form_alter(&$form, &$form_state, $form_id) {
  $path = implode('/', array_slice(arg(), 0, 5));
  if (($form_id != 'block_admin_configure' || $path != 'admin/structure/block/manage/boxes') && 
      ($form_id != 'boxes_add_form' || arg(3) != 'box-add')) {
    return;
  }
  
  // Use the Box form submit handler and properly redirect to the correct admin page
  array_unshift($form['#submit'], 'boxes_box_form_submit');
  $form['#action'] .= '?destination=admin/structure/block';
  
  // Cancel behavior is different here
  unset($form['cancel']['#attributes']);
  $form['cancel']['#submit'] = array('boxes_block_cancel_submit');
}
CommentFileSizeAuthor
#1 boxes-https-1948170-1.patch547 bytesmpotter
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mpotter’s picture

FileSize
547 bytes

I can confirm this issue and the fix above seems to work for me. Here is a proper patch for it.

mpotter’s picture

Status: Active » Needs review
tirdadc’s picture

Assigned: Unassigned » tirdadc
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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