- Issue created by @bogdog400
- πΊπΈUnited States bogdog400
This seems to be common: https://www.drupal.org/node/3201242 β
See also: https://www.drupal.org/project/prevnext/issues/3341627 π Entity queries must explicitly set whether the query should be access checked or not Fixed
And: https://www.drupal.org/project/structure_sync/issues/3330219 π Fatal error on D10: Entity queries must explicitly set access Fixed
- πΊπΈUnited States bogdog400
Here's one temporary solution I found. Just add the accessCheck call to core.
This is what the execute code looks like in my version of core/lib/Drupal/Core/Entity/Query/Sql/Query.php now:
/** * {@inheritdoc} */ public function execute() { return $this ->accessCheck(TRUE) ->prepare() ->compile() ->addSort() ->finish() ->result(); }
That's not a great solution but it allows me to keep doing my work.
A better solution may be to call accessCheck before execute inside the commerce module.
- πΊπΈUnited States bogdog400
I also add the line to src/LicenseStorage.php like this:
public function getExistingLicense(ProductVariationInterface $variation, $uid) { $existing_licenses_ids = $this->getQuery() ->condition('state', ['active', 'renewal_in_progress'], 'IN') ->condition('uid', $uid) ->condition('product_variation', $variation->id()) ->accessCheck(TRUE) ->execute(); if (!empty($existing_licenses_ids)) { $existing_license_id = array_shift($existing_licenses_ids); return $this->load($existing_license_id); } return FALSE; }
- Assigned to TomTech
-
TomTech β
authored 32dc7811 on 8.x-2.x
Issue #3352110 by bogdog400, TomTech: Exception when adding licensed...
-
TomTech β
authored 32dc7811 on 8.x-2.x
- Status changed to Fixed
over 1 year ago 5:15am 21 May 2023 - πΊπΈUnited States TomTech
Note: please switch to the 3.0.x version for 10.x.
Automatically closed - issue fixed for 2 weeks with no activity.