Browse Source

added access check to entity queries that were missing the check

d10-dev
Paul Pound 1 year ago
parent
commit
32291d759c
  1. 3
      src/Plugin/Field/FieldType/ReserveCategory.php
  2. 3
      src/Plugin/Field/FieldWidget/ReserveCategorySelect.php

3
src/Plugin/Field/FieldType/ReserveCategory.php

@ -64,7 +64,8 @@ class ReserveCategory extends FieldItemBase implements FieldItemInterface {
*/
public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
// get a list of all Reserve Categories
$ids = \Drupal::entityQuery('reserve_category')->sort('name', 'ASC')->execute();
$ids = \Drupal::entityQuery('reserve_category')->accessCheck(TRUE)
->sort('name', 'ASC')->execute();
$categories = \Drupal\reserve\Entity\ReserveCategory::loadMultiple($ids);
$options = array();
foreach ($categories as $cat) {

3
src/Plugin/Field/FieldWidget/ReserveCategorySelect.php

@ -30,7 +30,8 @@ class ReserveCategorySelect extends WidgetBase {
// get a list of all Reserve Categories for this bundle
$set = $items->getSettings()['categories'];
$ids = \Drupal::entityQuery('reserve_category')->sort('name', 'ASC')->execute();
$ids = \Drupal::entityQuery('reserve_category')->accessCheck(TRUE)
->sort('name', 'ASC')->execute();
$categories = ReserveCategory::loadMultiple($ids);
$options = array();
foreach ($categories as $key => $cat) {

Loading…
Cancel
Save