Browse Source

Fixes core block placement: Issue 931 (#99)

* Form altering out our custom Conditions, which don't play well with Core block placement

* Diagnosing Travis

* Coding standards

* Reverting .travis.yml
pull/756/head
dannylamb 6 years ago committed by Natkeeran
parent
commit
9fb4702ca8
  1. 18
      islandora.module

18
islandora.module

@ -15,6 +15,7 @@
*/ */
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Drupal\media\MediaInterface; use Drupal\media\MediaInterface;
use Drupal\file\FileInterface; 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']);
}

Loading…
Cancel
Save