diff --git a/islandora.module b/islandora.module index c1d6b17c..3e06b0af 100644 --- a/islandora.module +++ b/islandora.module @@ -15,6 +15,7 @@ */ use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\node\NodeInterface; use Drupal\media\MediaInterface; use Drupal\file\FileInterface; @@ -322,3 +323,20 @@ function islandora_entity_form_display_alter(&$form_display, $context) { } } } + +/** + * Implements hook_form_form_id_alter(). + */ +function islandora_form_block_form_alter(&$form, FormStateInterface $form_state, $form_id) { + // Unset our custom conditions. There's too many to use well within + // the core block placement UI, and no other reasonable way to filter + // them out. See https://www.drupal.org/node/2284687. Use + // /admin/structure/context instead if you want to use these conditions + // to alter block layout. + unset($form['visibility']['content_entity_type']); + unset($form['visibility']['parent_node_has_term']); + unset($form['visibility']['media_has_term']); + unset($form['visibility']['file_uses_filesystem']); + unset($form['visibility']['node_has_term']); + unset($form['visibility']['media_uses_filesystem']); +}