Skip to content
Snippets Groups Projects
Commit 0d574a55 authored by David Hasell's avatar David Hasell Committed by Liam Morland
Browse files

Issue #3297233: Add ::accessCheck() call to every entityQuery

parent 996bdd71
No related branches found
No related tags found
No related merge requests found
......@@ -236,6 +236,7 @@ class FillPdfForm extends ContentEntityBase implements FillPdfFormInterface {
public function getFormFields() {
$field_ids = \Drupal::entityQuery('fillpdf_form_field')
->condition('fillpdf_form', $this->id())
->accessCheck(TRUE)
->execute();
$field_storage = \Drupal::entityTypeManager()->getStorage('fillpdf_form_field');
$fields = $field_storage->loadMultiple($field_ids);
......
......@@ -83,7 +83,7 @@ class FillPdfFormDeleteFormTest extends BrowserTestBase {
$form_id = $this->getLatestFillPdfForm();
// Verify the FillPdfForm's fields are stored.
$field_ids = \Drupal::entityQuery('fillpdf_form_field')->condition('fillpdf_form', $form_id)->execute();
$field_ids = \Drupal::entityQuery('fillpdf_form_field')->condition('fillpdf_form', $form_id)->accessCheck(TRUE)->execute();
$this->assertCount(4, $field_ids, "4 FillPdfFormFields have been created.");
// We're on the edit form. Click 'Delete' and confirm deletion.
......
......@@ -45,7 +45,7 @@ class FillPdfFormDuplicateFormTest extends BrowserTestBase {
$template_fid = FillPdfForm::load($form_id)->fid->value;
// Verify the FillPdfForm's fields are stored.
$field_ids = \Drupal::entityQuery('fillpdf_form_field')->condition('fillpdf_form', $form_id)->execute();
$field_ids = \Drupal::entityQuery('fillpdf_form_field')->condition('fillpdf_form', $form_id)->accessCheck(TRUE)->execute();
$this->assertCount(4, $field_ids, "4 FillPdfFormFields have been created.");
// We're now on the edit form. Add an admin title.
......@@ -73,7 +73,7 @@ class FillPdfFormDuplicateFormTest extends BrowserTestBase {
// but are using the same template file.
$new_form_id = $this->getLatestFillPdfForm();
$this->assertNotEquals($new_form_id, $form_id);
$field_ids = \Drupal::entityQuery('fillpdf_form_field')->condition('fillpdf_form', $new_form_id)->execute();
$field_ids = \Drupal::entityQuery('fillpdf_form_field')->condition('fillpdf_form', $new_form_id)->accessCheck(TRUE)->execute();
foreach ($field_ids as $id) {
$this->assertNotNull(FillPdfFormField::load($id), "The FillPdfFormField #{$id} has ben duplicated.");
}
......
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