- 🇭🇰Hong Kong eric_lee
one of my colleague also faced this issue
there was no any issue in modules or core file
Actually he was copying whole DB and source code to different machine and trying to run drupal
later we find the users table does not contain 0 uid
and it was actually at 14 uid, then we updated 14 -> 0 uid and it seems all work fine - 🇮🇳India anuragsharmam
Just to confirm, I have a user with uid 0 and I'm still facing the error.
After applying the patch from #5, it works fine. I suggest considering the issue and reviewing the suggested patch again. - Status changed to Needs review
almost 2 years ago 1:28pm 5 July 2023 - Status changed to Closed: works as designed
9 months ago 2:36pm 1 July 2024 - 🇺🇸United States agentrickard Georgia (US)
Other code breaking the API is not our responsibility. That issue should be filed upstream with the caller.
- 🇬🇧United Kingdom swatichouksey4u
I have a user with uid 0 and I'm still facing the error.
The suggested changes in patch #5 work for me. however, I am using the 2.0.0-beta2 version and couldn't apply the patch. So based on #5 I have created patch 6 which works well. - 🇧🇪Belgium andreasderijcke Antwerpen / Gent
AccountInterface instance can have no ID in valid use cases, even though the AccountInterface does not say so (but should).
A good example is the Search API RenderedItem processor: a User(Session) is created on the fly to render and index entities for that user's role. This user is never saved, thus has no ID.
See https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Plugin/...Should the AccountInterface get updated to reflect the fact that the ID can be NULL, it still needs to be handled here.
- 🇺🇸United States agentrickard Georgia (US)
I do not think that is valid. It is an abuse of the API. If anything, it should be caught upstream before hook_node_grants is called.
Also, the link to the code does not seem relevant to this issue. That code seems to have moved https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Plugin/...
- Status changed to Needs work
4 days ago 6:06pm 2 April 2025