Commit aef67cd5 authored by catch's avatar catch
Browse files

Issue #3202040 by jonathanshaw: EntityQuery accessCheck: bundle delete forms...

Issue #3202040 by jonathanshaw: EntityQuery accessCheck: bundle delete forms should warn of content at risk regardless of access
parent f407fad8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ class BlockContentTypeDeleteForm extends EntityDeleteForm {
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $blocks = $this->entityTypeManager->getStorage('block_content')->getQuery()
      ->accessCheck(FALSE)
      ->condition('type', $this->entity->id())
      ->execute();
    if (!empty($blocks)) {
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ public static function create(ContainerInterface $container) {
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $comments = $this->entityTypeManager->getStorage('comment')->getQuery()
      ->accessCheck(FALSE)
      ->condition('comment_type', $this->entity->id())
      ->execute();
    $entity_type = $this->entity->getTargetEntityTypeId();
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public static function create(ContainerInterface $container) {
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $num_entities = $this->entityTypeManager->getStorage('media')->getQuery()
      ->accessCheck(FALSE)
      ->condition('bundle', $this->entity->id())
      ->count()
      ->execute();
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ class NodeTypeDeleteConfirm extends EntityDeleteForm {
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $num_nodes = $this->entityTypeManager->getStorage('node')->getQuery()
      ->accessCheck(FALSE)
      ->condition('type', $this->entity->id())
      ->count()
      ->execute();