Commit 10dd1590 authored by Cody Craven's avatar Cody Craven
Browse files

Issue #1143622 by codycraven, vito_swat: Fixed inability to enable/disable...

Issue #1143622 by codycraven, vito_swat: Fixed inability to enable/disable term page displays when Display Suite is not installed/enabled.
parent c27b024c
......@@ -2,6 +2,8 @@
Taxonomy Display 7.x-1.x, YYYY-MM-DD
------------------------------------
Issue #1143622 by codycraven, vito_swat: Fixed inability to enable/disable term
page displays when Display Suite is not installed/enabled.
Taxonomy Display 7.x-1.0-alpha2, 2011-04-18
-------------------------------------------
......
......@@ -37,7 +37,7 @@ function taxonomy_display_admin_form(&$form, &$form_state) {
// display to match.
$entity_info = entity_get_info('taxonomy_term');
$view_mode_settings = field_view_mode_settings('taxonomy_term', $form['#bundle']);
if ($view_mode_settings['full']['custom_settings']) {
if (isset($view_mode_settings['full']['custom_settings'])) {
$field['#description'] = 'To alter the term page display you need to go to the <em>Taxonomy term page</em> view mode.';
}
else {
......@@ -112,12 +112,16 @@ function taxonomy_display_admin_form_setup_additional_settings(&$form) {
$form['additional_settings']['modes']['#weight'] = -10;
unset($form['modes']);
}
// Layout needs be first so we can reset the type key for Field API fields.
$form['#validate'][] = 'taxonomy_display_field_ui_layouts_validate';
}
/**
* Form submit callback; save Taxonomy Display settings for term pages.
*/
function taxonomy_display_admin_form_submit($form, &$form_state) {
dpm($form_state);
$values =& $form_state['values']['additional_settings']['taxonomy_display'];
$td_form =& $form['additional_settings']['taxonomy_display'];
......@@ -184,6 +188,17 @@ function taxonomy_display_ajax_term_display_callback($form, $form_state) {
return $form['additional_settings']['taxonomy_display']['term_display_form'];
}
/**
* Validate handler; Move the view modes so Field UI can handle them.
*
* Modified from Display Suite since we are using the same form set.
*/
function taxonomy_display_field_ui_layouts_validate($form, &$form_state) {
if (isset($form_state['values']['additional_settings']['modes']['view_modes_custom'])) {
$form_state['values']['view_modes_custom'] = $form_state['values']['additional_settings']['modes']['view_modes_custom'];
}
}
/**
* Helper function; build the admin form for plugins.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment