Add a check exist on node_has_term instead of comment it out
This commit is contained in:
parent
4c531a62d3
commit
af67bfcd2f
1 changed files with 11 additions and 9 deletions
|
|
@ -88,15 +88,17 @@ function islandora_advanced_search_form_block_form_alter(&$form, FormStateInterf
|
|||
$condition_id = 'node_has_term';
|
||||
|
||||
/** @var \Drupal\Core\Condition\ConditionInterface $condition */
|
||||
/*$condition = $manager->createInstance($condition_id, isset($visibility[$condition_id]) ? $visibility[$condition_id] : []);
|
||||
$form_state->set(['conditions', $condition_id], $condition);
|
||||
$condition_form = $condition->buildConfigurationForm([], $form_state);
|
||||
$condition_form['#type'] = 'details';
|
||||
$condition_form['#title'] = $condition->getPluginDefinition()['label'];
|
||||
$condition_form['#group'] = 'visibility_tabs';
|
||||
// Not all blocks are required to give this field.
|
||||
$condition_form['term']['#required'] = FALSE;
|
||||
$form['visibility'][$condition_id] = $condition_form;*/
|
||||
if (array_key_exists($condition_id,$visibility)) {
|
||||
$condition = $manager->createInstance($condition_id, isset($visibility[$condition_id]) ? $visibility[$condition_id] : []);
|
||||
$form_state->set(['conditions', $condition_id], $condition);
|
||||
$condition_form = $condition->buildConfigurationForm([], $form_state);
|
||||
$condition_form['#type'] = 'details';
|
||||
$condition_form['#title'] = $condition->getPluginDefinition()['label'];
|
||||
$condition_form['#group'] = 'visibility_tabs';
|
||||
// Not all blocks are required to give this field.
|
||||
$condition_form['term']['#required'] = FALSE;
|
||||
$form['visibility'][$condition_id] = $condition_form;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue