- 🇲🇼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()