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.
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');
}
Comment | File | Size | Author |
---|---|---|---|
#1 | boxes-https-1948170-1.patch | 547 bytes | mpotter |
Comments
Comment #1
mpotter CreditAttribution: mpotter commentedI can confirm this issue and the fix above seems to work for me. Here is a proper patch for it.
Comment #2
mpotter CreditAttribution: mpotter commentedComment #3
tirdadc CreditAttribution: tirdadc commentedCommitted, thanks!
http://drupalcode.org/project/boxes.git/commit/18bd899