Problem/Motivation
While working on upgrades to Drupal 10 Upgrade status provided these errors as needing to be resolved manually:
On Line 123 of web/modules/contrib/admin_toolbar/admin_toolbar_search/src/SearchLinks.php
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
On Line 114 of web/modules/contrib/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
Proposed resolution
Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE
Remaining tasks
Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | 3338408-26.patch | 1.99 KB | yuvania |
| #25 | 3338408-access_check_errors_for_D10_compatibility.patch | 2.38 KB | sashainparis |
| #24 | access_check_errors_for_D10_compatibility.patch | 2.26 KB | radheymkumar |
| #14 | 3338408-fix-access-check-error.patch | 1.99 KB | edmund.dunn |
| #11 | 3338408-11.patch | 1.93 KB | rajab natshah |
Issue fork admin_toolbar-3338408
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
elkaro commentedComment #3
elkaro commentedComment #4
jjcarrionPatch #2 worked for me for the Drupal 10 upgrade,
Thanks!
Comment #5
jheinon_finland commentedGreetings!
I tested this on my local installation for a Drupal 9 site. The patch applied successfully and I have thus updated the status from
Needs reviewtoReviewed & tested by the community.Comment #6
rajab natshahThe patch #2 is working.
Thank you, lelkneralfaro!
Comment #9
kunal_sahu commentedHi @all Tested the patch. The patch LGTM.
RTBC++ #2.
Creating a MR for helping the maintainer.
please review and merge this MR.
Thanks
Comment #10
berdirit's pretty much a false positive, those are *very likely* config entities (never seen a content bundle entity, doesn't make sense), it won't do anything but if we do something it should be an accessCheck(FALSE) just in case core ever actually adds access checks/query altering to config entity queries.
Either way, you can safely ignore this and do not need to apply it as a patch to your site.
Comment #11
rajab natshahComment #13
rajab natshahComment #14
edmund.dunn commented#11 would not apply. I rerolled it for the latest release(3.4.1).
Comment #16
prabuela commentedComment #17
prabuela commentedComment #18
prabuela commentedComment #19
prabuela commentedComment #20
szato commentedChecked patch from #14 (and re-run automated tests for D10.1, D9.5 with php 8.1/Mysql 8 - passed).
Works for me.
@PrabuEla
I hid your patch because you changed accessCheck(FALSE) to accessCheck(TRUE) - which was already discussed in #10 and implemented in #11 and in #14.
Comment #21
szato commentedI hid patch from #2 too.
Comment #22
dillix commentedPlease make new release with this patch, so we can update sites to D10.
Comment #23
berdirYou don't need this patch, the module works perfectly well on D10 without it. See #10.
Comment #24
radheymkumar commentedI fixed access check errors for D10 compatibility. attached patch.
Thanks
Comment #25
sashainparis#24: was founded on the project base path.
Update patch to consider the sort() added in between on these lines.
Using the module base path.
Comment #26
yuvaniaI fixed access check errors for D10 compatibility
Comment #27
ericvl@yuvania
This is the same patch as in #14.
See also remarks in #10 and #23.
Comment #28
saganakat commentedThe patch in comment #14 has worked for drupal 10.1
Comment #29
rajab natshahComment #30
skaughtAgree: tested patch #14 [3338408-fix-access-check-error.patch] applies as expected.
Comment #32
prashant.cRe-based with 3.x, needs to be reviewed.
Thanks
Comment #33
keshavv commentedAdded a comment in the MR. If someone review and update?
https://git.drupalcode.org/project/admin_toolbar/-/merge_requests/51
Comment #34
japerry