Noticed recently that entityqueue passes queue names when calling $entity->id().
Specifically, line 27 of permissions_by_term.module passes:
if ($cache->hasAccessResultsCache($account->id(), $entity->id())) {
When this goes into hasAccessResultsCache in/src/Cache/AccessResultCache.php, its forcing int for the id on line 61:
public function hasAccessResultsCache(int $accountId, int $entityId): bool {
Entity Queue uses a text value for id/name field. $entity->id() when called for an entityqueue returns the following in my case:
editors_picks
Not sure where is the best place to bring up this issue. I suspect entityqueue should be using int for id's and not a string. Also not sure if that's a hard requirement for Drupal. In either event, we could remove the "int" requirement for setting and accessing result cache. That's the only way I can see resolving the issue for now.
Thoughts?
Issue fork permissions_by_term-3150746
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
bstan commentedI have seen this as well
Comment #3
amateescu commentedUsing string IDs for entityqueue was a design decision, and it's a use case that is fully supported by Drupal core :)
public function hasAccessResultsCache(int $accountId, int $entityId): bool {This is the part that needs to be fixed, the int type is arbitrarily placed there.
Comment #5
amateescu commentedComment #6
eahonet commentedThank you @amateescu
Removing the three "int"s as shown in the merge request did do the trick for me. I can now access my entityequeues.
Comment #8
jepster_@eahonet: Thanks for testing and sharing your patches! I have reviewed your patches and added them to the latest releases:
Drupal 9 version (3.1.5): https://www.drupal.org/project/permissions_by_term/releases/3.1.5
Drupal 8 version (8.x-2.28): https://www.drupal.org/project/permissions_by_term/releases/8.x-2.28
Comment #9
jepster_