From 25f1a2d208c7d2c4a2ba815f440c268c0180b65d Mon Sep 17 00:00:00 2001 From: Camilo Villamizar Date: Wed, 25 Oct 2023 14:00:56 -0300 Subject: [PATCH] POMP-166 Update queries w/ accessCheck() call --- custom/modules/address/address.module | 7 ++++--- custom/modules/award/award.module | 4 ++++ custom/modules/graduations_scripts/scripts/upd_terms.php | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/custom/modules/address/address.module b/custom/modules/address/address.module index e71c8bf8..6288814b 100644 --- a/custom/modules/address/address.module +++ b/custom/modules/address/address.module @@ -17,9 +17,10 @@ function address_preprocess_node__address(&$variables) { $nid = $address_node->id(); // Query for parent ceremony. $ceremony_q = \Drupal::entityQuery('node') - ->condition('type', 'graduation_ceremony') - ->condition('field_addresses', $nid) - ->execute(); + ->condition('type', 'graduation_ceremony') + ->condition('field_addresses', $nid) + ->accesscheck(true) + ->execute(); // Get ceremony id. $ceremony_id = $ceremony_q ? reset($ceremony_q) : NULL; diff --git a/custom/modules/award/award.module b/custom/modules/award/award.module index ff5fb81a..7723b880 100644 --- a/custom/modules/award/award.module +++ b/custom/modules/award/award.module @@ -19,6 +19,7 @@ function award_preprocess_node__award(&$variables) { $ceremony_q = \Drupal::entityQuery('node') ->condition('type', 'graduation_ceremony') ->condition('field_awards', $nid) + ->accesscheck(true) ->execute(); // Get ceremony id. @@ -109,6 +110,7 @@ function award_form_node_award_form_alter(&$form, $form_state, $form_id) { // Recover term ids for all award types. $tids = \Drupal::entityQuery('taxonomy_term') ->condition('vid', 'award_type') + ->accesscheck(true) ->execute(); // Build associative array with name => tid for award types. @@ -183,6 +185,7 @@ function award_form_node_award_edit_form_alter(&$form, $form_state, $form_id) { // Recover term ids for all award types. $tids = \Drupal::entityQuery('taxonomy_term') ->condition('vid', 'award_type') + ->accesscheck(true) ->execute(); // Build associative array with name => tid for award types. @@ -259,6 +262,7 @@ function award_inline_entity_form_entity_form_alter(&$entity_form, $form_state) // Recover term ids for all award types. $tids = \Drupal::entityQuery('taxonomy_term') ->condition('vid', 'award_type') + ->accesscheck(true) ->execute(); // Build associative array with name => tid for award types. diff --git a/custom/modules/graduations_scripts/scripts/upd_terms.php b/custom/modules/graduations_scripts/scripts/upd_terms.php index 33ac534d..5d528f13 100644 --- a/custom/modules/graduations_scripts/scripts/upd_terms.php +++ b/custom/modules/graduations_scripts/scripts/upd_terms.php @@ -179,6 +179,7 @@ $found = \Drupal::entityQuery('taxonomy_term') ->condition('vid', 'honorary_degree') ->condition('name', $honorary_degree) + ->accesscheck(true) ->execute(); if ($found) { @@ -238,6 +239,7 @@ function add_terms($vid, array $terms) { $found = \Drupal::entityQuery('taxonomy_term') ->condition('vid', $vid) ->condition('name', $term) + ->accesscheck(true) ->execute(); if (!$found) {