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.
Problem/Motivation
After updating location module to version 7.x-3.0-alpha8 location field was moved outside "vertical tab".
Proposed resolution
Found this code on location_form Line 1890 of location.module.
if ($settings['multiple']['max'] == 1 || $settings['multiple']['add'] == 1) {
$form = array(
'#prefix' => '<div class="location-wrapper">',
'#suffix' => '</div>',
'#tree' => TRUE,
'#weight' => $settings['form']['weight'],
);
}
else {
$form = array(
'#type' => 'fieldset',
'#title' => format_plural($numforms, 'Location', 'Locations'),
'#tree' => TRUE,
'#attributes' => array('class' => array('locations')),
'#weight' => $settings['form']['weight'],
'#collapsible' => $settings['form']['collapsible'],
'#collapsed' => $settings['form']['collapsed'],
);
}
In my set up, "max" and "add" are both equal to 1, but I don't think I want my location field outside vertical (not in vertical tab).
Removing that condition works for me (or altering the location_form to use the #type => fieldset).
$form = array(
'#type' => 'fieldset',
'#title' => format_plural($numforms, 'Location', 'Locations'),
'#tree' => TRUE,
'#attributes' => array('class' => array('locations')),
'#weight' => $settings['form']['weight'],
'#collapsible' => $settings['form']['collapsible'],
'#collapsed' => $settings['form']['collapsed'],
);
See attached file for sample screenshot (location-field-not-in-vertical-tab.png)
Comment | File | Size | Author |
---|---|---|---|
location-field-not-in-vertical-tab.png | 198.5 KB | adriancruz |