keinstein → created an issue.
keinstein → created an issue.
I just came across this issue with 9.5.x. so it is still active.
@Lendude The root cause for this bug is that the object is left in an invalid internal state. Everything else depends on this bug. Either the triggering code is not fixed because the error is accepted by assignEntitiesToResult
or several functions in core/modules/views/src/Plugin/views/query/Sql.php
are broken and shoudl be fixed that the invalid state is correct.
A short scan over my Drupal installations reveals that it's nearly impossible to decide what is intended.
Here are the results:
$ grep -e '_relationship_entities' -r .|grep -v test
./core/modules/views/src/ResultRow.php: public $_relationship_entities = [];
./core/modules/views/src/ResultRow.php: * Resets the _entity and _relationship_entities properties.
./core/modules/views/src/ResultRow.php: $this->_relationship_entities = [];
./core/modules/views/src/Plugin/views/cache/CachePluginBase.php: if (!empty($row->_relationship_entities)) {
./core/modules/views/src/Plugin/views/cache/CachePluginBase.php: foreach ($row->_relationship_entities as $key => $entity) {
./core/modules/views/src/Plugin/views/cache/CachePluginBase.php: $row_data = array_diff_key((array) $row, array_flip(['index', '_entity', '_relationship_entities'])) + $this->getRowCacheTags($row);
./core/modules/views/src/Plugin/views/field/FieldPluginBase.php: elseif (isset($values->_relationship_entities[$relationship_id])) {
./core/modules/views/src/Plugin/views/field/FieldPluginBase.php: return $values->_relationship_entities[$relationship_id];
./core/modules/views/src/Plugin/views/query/QueryPluginBase.php: * $result->_relationship_entities[$relationship_id];
./core/modules/views/src/Plugin/views/query/Sql.php: * $result->_relationship_entities[$relationship_id];
./core/modules/views/src/Plugin/views/query/Sql.php: $results[$index]->_relationship_entities[$relationship_id] = $entity;
./core/modules/views/src/Plugin/views/query/Sql.php: foreach ($row->_relationship_entities as $entity) {
As you can see _relationship_entities
is a public member. So CachePluginBase Sql.php cannot rely on non-null entries in _relationship_entities. So my suggestion is:
- In the next major release: Throw an exception if an entity is not valid in
assignEntitiesToResult
- In all other releases issue a warning instead and silently accept the invalid state without crashing in
getAllEntities
Currently code must always check that a certain key contains no null value. With the fix in place people must check that the key exists. What you prefer is a question of coding style and which one is faster depends on the actual application.
@cilefen What do you mean with the links?
I don't see why change in templates/layout/page.html.twig
or playing around with scss
and css
files should trigger such a bug.
A framework that is so sensitive to changes is buggy in my opinion. Or in other words: If the theme is buggy the framework should help the themers to track down the error and not blur it.
Btw.: How do the links relate to https://www.drupal.org/node/2934192 → and the comment in the following source code?
// @todo At the moment we do not need the current user context, which is
// triggering some test failures. We can remove these lines once
// https://www.drupal.org/node/2934192 is fixed.
keinstein → created an issue.
Actually I don't remember. I think nodes and Menu items were involved. I have German, English and Russian translations active. Most of the failed queries involved migration state tables. And I don't think that this issue can be solved only for some migrations.
My solution was:
Change all tables to utf8mb4_unicode_ci, and then I exposed the missing database parameters such as collation to the migration form, so that the new database can be generated as utf8mb4_unicode_ci instead of utf8mb4_general_ci. This is a way that worked for me.
If you want to reproduce the issue try to set up a drupal site with real language content (umlauts, cyrillic letters, etc.) in utf8mb4_unicode_ci encoding and upgrade it using stock Drupal 9.
Maybe the result changes depending whether you allow incremental upgrades. I had them enabled.
I don't know how to create and execute a corresponding test case.