Commit ed6fcaaf authored by Cody Craven's avatar Cody Craven
Browse files

Issue #1231346 by codycraven: Remove the ability to select whether taxonomy...

Issue #1231346 by codycraven: Remove the ability to select whether taxonomy term's fields should be displayed even if the description field is empty, now in core.
parent c8adb385
......@@ -2,6 +2,9 @@
Taxonomy Display 7.x-1.x, YYYY-MM-DD
------------------------------------
Issue #1231346 by codycraven: Remove the ability to select whether taxonomy
term's fields should be displayed even if the description field is empty, now
in core.
Issue #1188126 by scuba_fly: Added spaces to two lines for coding standards.
Taxonomy Display 7.x-1.0-beta1, 2011-05-09
......
......@@ -13,25 +13,18 @@ class TaxonomyDisplayTermDisplayHandlerCore extends TaxonomyDisplayTermDisplayHa
public function displayTerm($term, $options = NULL) {
$build = array();
// Allow display of term's additional content even if the description field
// is blank, if the option is enabled.
// @see http://drupal.org/node/796692
if ($options && $options['display_fields_description_empty']) {
$build = array(
'#prefix' => '<div class="term-listing-heading">',
'#suffix' => '</div>',
'term' => taxonomy_term_view($term, 'full'),
);
if (empty($term->description)) {
unset($build['description']);
}
}
elseif (!empty($term->description)) {
$build = array(
'#prefix' => '<div class="term-listing-heading">',
'#suffix' => '</div>',
'term' => taxonomy_term_view($term, 'full'),
);
$build = array(
'#prefix' => '<div class="term-listing-heading">',
'#suffix' => '</div>',
'term' => taxonomy_term_view($term, 'full'),
);
// We unset $build description key if the Drupal version is less than 7.2
// and description is empty because the taxonomy_term_view() generation was
// fixed to not include description, when empty, at that point. Done for
// compatibility for sites using less than version 7.2.
if (empty($term->description) && version_compare('7.2', VERSION) == 1) {
unset($build['description']);
}
return $build;
......@@ -44,14 +37,6 @@ class TaxonomyDisplayTermDisplayHandlerCore extends TaxonomyDisplayTermDisplayHa
*/
public function formFieldset(&$form, &$values, $options = NULL) {
$form['#description'] = t('The core Drupal functionality will be used to display the term.');
$form['display_fields_description_empty'] = array(
'#default_value' => isset($options['display_fields_description_empty']) ? $options['display_fields_description_empty'] : 0,
'#description' => t('If a taxonomy term does not have a description entered Drupal core will not display any of its fields. Selecting <em>yes</em> will overcome <a href="!link">this problem</a>.', array('!link' => url('http://drupal.org/node/796692'))),
'#options' => array(t('No'), t('Yes')),
'#title' => t('Render term when the description field is empty?'),
'#type' => 'radios',
);
}
/**
......
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