Problem/Motivation
I've just migrated a site from version 9.5.11 to 10.3.5 and everything went fine, except that I'm having a problem updating some fields which are all of type Entity Reference -> views reference. With drush upe --show
, I can see my 3 upgradable entities:
vmeso@vmeso:~/htdocs/esod10$ drush upe --show
-> node. Change(s) : 3
The field node.field_contact_project_search needs to be updated.
Field node.field_pub_anr needs to be updated.
The field node.field_publications_member_eso needs to be updated.
-> Entity type 'node' is updatable.
-> Use: drush upe node
But when I apply: drush upe node, I get the following message:
[warning] array_flip(): Can only flip string and integer values, entry skipped SqlContentEntityStorageSchema.php:2476
[warning] array_flip(): Can only flip string and integer values, entry skipped SqlContentEntityStorageSchema.php:2476
[warning] Undefined array key "node__field_contact_projet_recherche" SqlContentEntityStorageSchema.php:2479
[warning] Trying to access array offset on null SqlContentEntityStorageSchema.php:2479
[warning] Trying to access array offset on null SqlContentEntityStorageSchema.php:2479
[error] TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in array_intersect_key() (line 2479 of /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php) #0 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(2479): array_intersect_key()
#1 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(1749): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->hasColumnChanges()
#2 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(1529): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->updateDedicatedTableSchema()
#3 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(703): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->performFieldSchemaOperation()
#4 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1552): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->onFieldStorageDefinitionUpdate()
#5 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1597): Drupal\Core\Entity\Sql\SqlContentEntityStorage->Drupal\Core\Entity\Sql\{closure}()
#6 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1551): Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException()
#7 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php(104): Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldStorageDefinitionUpdate()
#8 /home/vmeso/htdocs/esod10/modules/contrib/devel_entity_updates/src/DevelEntityDefinitionUpdateManager.php(199): Drupal\Core\Field\FieldStorageDefinitionListener->onFieldStorageDefinitionUpdate()
#9 /home/vmeso/htdocs/esod10/modules/contrib/devel_entity_updates/src/DevelEntityDefinitionUpdateManager.php(143): Drupal\devel_entity_updates\DevelEntityDefinitionUpdateManager->doFieldUpdate()
#10 /home/vmeso/htdocs/esod10/modules/contrib/devel_entity_updates/src/Commands/DevelEntityUpdatesCommands.php(104): Drupal\devel_entity_updates\DevelEntityDefinitionUpdateManager->applyUpdates()
#11 /home/vmeso/htdocs/esod10/modules/contrib/devel_entity_updates/src/Commands/DevelEntityUpdatesCommands.php(65): Drupal\devel_entity_updates\Commands\DevelEntityUpdatesCommands->doEntityUpdates()
#12 [internal function]: Drupal\devel_entity_updates\Commands\DevelEntityUpdatesCommands->entityUpdates()
#13 /home/vmeso/htdocs/esod10/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#14 /home/vmeso/htdocs/esod10/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#15 /home/vmeso/htdocs/esod10/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#16 /home/vmeso/htdocs/esod10/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#17 /home/vmeso/htdocs/esod10/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#18 /home/vmeso/htdocs/esod10/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#19 /home/vmeso/htdocs/esod10/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#20 /home/vmeso/htdocs/esod10/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#21 /home/vmeso/htdocs/esod10/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#22 /home/vmeso/htdocs/esod10/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#23 /home/vmeso/htdocs/esod10/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#24 /home/vmeso/htdocs/esod10/vendor/drush/drush/drush(4): require('...')
#25 {main}.
TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php on line 2479 #0 /home/vmeso/htdocs/esod10/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(2479): array_intersect_key()
I've tried to empty the contents of the nodes in question, but nothing works, and the database schema cannot be updated for these fields.
I've tried with drush updatedb, and nothing, in fact, i have this message :
<code>PHP Fatal error: Declaration of Consolidation\Log\LoggerManager::log($level, Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::log($level, $message, array $context = []) in /home/vmeso/htdocs/esod10/vendor/consolidation/log/src/LoggerManager.php on line 146
. I think it's an another problem, not connected with the first.
Steps to reproduce
Difficult : migrate d9 to d10 with a content type in which there is an Entity Reference field to a view that must return a list of publications based on a condition (an author identifier). Works fine under D9, but... not after migration
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet