- 🇲🇼Malawi chancenyasulu
Can we change this parts
if (empty($entity)) {
+ continue;
+ }by using !is_null and instead of continue; replace it with these lines
first part: $tags = Cache::mergeTags($tags, $entity->getCacheTags());
second part: $tags = Cache::mergeTags($entity->getCacheTags(), $tags);
third part: $max_age = Cache::mergeMaxAges($max_age, $entity->getCacheMaxAge());if (empty($entity)) {
$tags = Cache::mergeTags($tags, $entity->getCacheTags());
} - 🇺🇸United States pramodganore
Any idea, when will this be merged into Drupal 10 ?
- 🇺🇸United States TimeFor
I encountered an error which was due to a corrupted entry in the 'users' table of the database. The issue arose when I transferred data between environments: MySQL failed to create the anonymous user with UID=0, instead assigning the next available UID. This newly assigned UID had no corresponding entry in the 'users_data' table, causing disruptions in views loading content associated with the anonymous user.
Though the above patch helped identify the root cause, it wasn't a permanent fix. To resolve the problem, I manually set the UID for the anonymous user to 0 in the database, eliminating the need for the patch.
I used Navicat MySQL for data transfer, but I'm uncertain if that's where the UID discrepancy began, or if it might be related to some default setting within the SQL database that prevents assignment of a UID of 0.
- 🇬🇧United Kingdom robcarr Perthshire, Scotland
@TimeFor - thanks for solution. I'd seen the error and it was exactly that issue where I'd transferred databases between environments. Worth noting as a potential Drupal general problem.
It was a case of looking in users_field_data table and comparing UIDs to the users table and seeing where there was a mismatch. In my case it was the highest UID in the users table that was erroneous - just edited the users table in PMA and altered the relevant UID value to 0
- 🇬🇧United Kingdom sadikyalcin
@TimeFor what a life saver. That was exactly the issue for me. I moved to a new db and watchdog kept breaking with cache errors.
Error: Call to a member function getCacheTags()
Error: Call to a member function getCacheMaxAge() - Status changed to Postponed: needs info
2 months ago 7:59pm 21 March 2025 Based on 🐛 Fatal error "getCacheTags() on null" on admin/content Views page Closed: works as designed being opened I am reopening this. It still needs steps to reproduce. 🐛 Fatal error "getCacheTags() on null" on admin/content Views page Closed: works as designed doesn't have any.
- 🇳🇿New Zealand quietone
Drupal 9 is End of Life.
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies → .
- 🇺🇸United States alphex Atlanta, GA USA
Patch in comment #2 worked on 10.4.6
- 🇫🇮Finland anaconda777
I got the same error on Drupal 10.4.7
It happened after deleting some nodes meanwhile ECA was analyzing the nodes and setting their moderation states etc. Maybe this was not the reason.Anyway like before someone instructed I managed to fix it and deleted the corrupted node like this:
1. Go to mysql console 2. use databasename; 3. SELECT nid FROM node_field_data WHERE nid NOT IN (SELECT n.nid from node n); 4. DELETE FROM node_revision WHERE nid = 12553; 4.1 DELETE FROM node_field_revision WHERE nid = 12553; 4.2 DELETE FROM node_field_data WHERE nid = 12553; 4.3 DELETE FROM node WHERE nid = 12553;