Skip to content
Snippets Groups Projects
Commit 275de269 authored by Liam Morland's avatar Liam Morland
Browse files

Issue #3367389: Add ::accessCheck() call to every ::getQuery()

parent d9002c19
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ function hook_fillpdf_populate_pdf_context_alter(array &$context): void {
$webform_submission_storage = \Drupal::entityTypeManager()->getStorage('webform_submission');
foreach ($context['entity_ids']['webform'] as $webform_id) {
// Load submission IDs from webform_submission storage.
$query = $webform_submission_storage->getQuery()->condition('webform_id', $webform_id);
$query = $webform_submission_storage->getQuery()->accessCheck(TRUE)->condition('webform_id', $webform_id);
$query->condition('uid', $uid);
$query->condition('in_draft', 0);
$query->sort('created', 'ASC');
......
......@@ -221,7 +221,7 @@ class FillPdfFormForm extends ContentEntityForm {
)->toString();
}
$entity_ids = $storage->getQuery()->range(0, self::SELECT_MAX + 1)->execute();
$entity_ids = $storage->getQuery()->accessCheck(TRUE)->range(0, self::SELECT_MAX + 1)->execute();
if (count($entity_ids) > self::SELECT_MAX) {
if (!isset($description)) {
$description = $this->t('Enter the title of a %type to test populating the PDF template.', [
......
......@@ -128,7 +128,8 @@ trait TestFillPdfTrait {
protected function getLatestFillPdfForm() {
$entity_query = $this->container->get('entity_type.manager')
->getStorage('fillpdf_form')
->getQuery();
->getQuery()
->accessCheck(TRUE);
$max_fid_after_result = $entity_query
->sort('fid', 'DESC')
->range(0, 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment