Browse Source

fixed issues reported by upgrade status module

d10-dev
Paul Pound 1 year ago
parent
commit
f949837ee1
  1. 6
      reserve.inc
  2. 2
      reserve.series.inc

6
reserve.inc

@ -28,7 +28,7 @@ function reserve_categories($ebundle = null) {
else { else {
$query = \Drupal::service('entity_type.manager') $query = \Drupal::service('entity_type.manager')
->getStorage('reserve_category')->getQuery(); ->getStorage('reserve_category')->getQuery();
$ids = $query->condition('status', TRUE)->execute(); $ids = $query->condition('status', TRUE)->accessCheck(FALSE)->execute();
} }
$cats = \Drupal::entityTypeManager()->getStorage('reserve_category')->loadMultiple($ids); $cats = \Drupal::entityTypeManager()->getStorage('reserve_category')->loadMultiple($ids);
@ -67,7 +67,7 @@ function reserve_entities($ebundle) {
} }
//->sort('reservations_display_order', 'ASC') //->sort('reservations_display_order', 'ASC')
$ids = $query->execute(); $ids = $query->accessCheck(FALSE)->execute();
$entities = \Drupal::entityTypeManager()->getStorage($entity_type)->loadMultiple($ids); $entities = \Drupal::entityTypeManager()->getStorage($entity_type)->loadMultiple($ids);
@ -933,6 +933,7 @@ function reserve_daily_max_exceeded($yyyy_mmdd) {
if ($user->id()) { if ($user->id()) {
$ids = \Drupal::service('entity_type.manager') $ids = \Drupal::service('entity_type.manager')
->getStorage('reserve_reservation')->getQuery() ->getStorage('reserve_reservation')->getQuery()
->accessCheck(FALSE)
->condition('user_id', $user->id()) ->condition('user_id', $user->id())
->condition('reservation_date', $yyyy_mmdd . '%', 'like') ->condition('reservation_date', $yyyy_mmdd . '%', 'like')
->execute(); ->execute();
@ -966,6 +967,7 @@ function reserve_user_reservations() {
$latest_date = date('Y-m-d', strtotime("now +13 days")); $latest_date = date('Y-m-d', strtotime("now +13 days"));
$ids = \Drupal::service('entity_type.manager') $ids = \Drupal::service('entity_type.manager')
->getStorage('reserve_reservation')->getQuery() ->getStorage('reserve_reservation')->getQuery()
->accessCheck(TRUE)
->condition('user_id', $user->id()) ->condition('user_id', $user->id())
->condition('reservation_date', $earliest_date, '>=') ->condition('reservation_date', $earliest_date, '>=')
->condition('reservation_date', $latest_date, '<=') ->condition('reservation_date', $latest_date, '<=')

2
reserve.series.inc

@ -130,6 +130,7 @@ function reserve_reserve_reservation_update($entity) {
// grab all reservations in this series except the one being submitted // grab all reservations in this series except the one being submitted
$ids = \Drupal::service('entity_type.manager') $ids = \Drupal::service('entity_type.manager')
->getStorage('reserve_reservation')->getQuery() ->getStorage('reserve_reservation')->getQuery()
->accessCheck(TRUE)
->condition('status', TRUE) ->condition('status', TRUE)
->condition('reservation_series_id', $sid) ->condition('reservation_series_id', $sid)
->condition('id', $entity->id(), '!=') ->condition('id', $entity->id(), '!=')
@ -183,6 +184,7 @@ function _reserve_series_delete($entity) {
// grab all reservations in this series // grab all reservations in this series
$ids = \Drupal::service('entity_type.manager') $ids = \Drupal::service('entity_type.manager')
->getStorage('reserve_reservation')->getQuery() ->getStorage('reserve_reservation')->getQuery()
->accessCheck(TRUE)
->condition('reservation_series_id', $sid) ->condition('reservation_series_id', $sid)
->execute(); ->execute();
$results = \Drupal::entityTypeManager()->getStorage('reserve_reservation')->loadMultiple($ids); $results = \Drupal::entityTypeManager()->getStorage('reserve_reservation')->loadMultiple($ids);

Loading…
Cancel
Save