Issue #1116326 by s_leu, yannickoo, dawehner, nod_, pwolanin, David_Rothstein, ksenzee, realityloop, miro_dietiker, broeker, mariagwyn, Christian DeLoach: Support admin overlay in exposed forms

merge-requests/26/head
David Rothstein 2016-07-03 17:07:16 -04:00
parent 5009eff28b
commit e06da1d7c3
2 changed files with 17 additions and 0 deletions

View File

@ -47,6 +47,9 @@ Drupal 7.50, xxxx-xx-xx (development version)
broke contributed modules that override the "admin/people" page.
- Fixed a bug which caused ip_address() to return nothing when the client IP
address and proxy IP address are the same.
- Made method="get" forms work inside the administrative overlay. The fix adds
a new hidden field to these forms when they appear inside the overlay (minor
data structure change).
Drupal 7.44, 2016-06-15
-----------------------

View File

@ -78,6 +78,20 @@ function overlay_theme() {
);
}
/**
* Implements hook_form_alter().
*/
function overlay_form_alter(&$form, &$form_state) {
// Add a hidden element to prevent dropping out of the overlay when a form is
// submitted inside the overlay using a GET method.
if (isset($form['#method']) && $form['#method'] == 'get' && isset($_REQUEST['render']) && $_REQUEST['render'] == 'overlay' && !isset($form['render'])) {
$form['render'] = array(
'#type' => 'hidden',
'#value' => 'overlay',
);
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/