- Issue created by @byrond
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Thanks, this is a recent issue introduced by Drupal 10.2, it is even failing our tests https://git.drupalcode.org/project/entity_hierarchy/-/jobs/820556
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Update the deriver logic, so it doesn't require an ERH field to exist before it makes the selection plugin available for an entity type.
These plugins will be broken though.
Can you get a stack trace? I wonder if we need to be invalidating a selection handler plugin cache at some point instead.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I think we probably want a hook_field_field_config_insert that calls ::clearCachedDefinitions on the ER select handler manager if the field-type is entity_hierarchy
- Open on Drupal.org βCore: 10.2.1 + Environment: PHP 8.1 & MySQL 8last update
7 months ago Waiting for branch to pass - Status changed to Needs review
7 months ago 9:43pm 15 February 2024 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
MR fixes the issue in HEAD
Can you confirm it resolves your install issue?
If so I can get a new release out today.
- πΊπΈUnited States byrond
It did not fix our issue. I'm not sure the cache clear will help in this case, because it is trying to create the field, which can't succeed until a field exists to be picked up by getDerivativeDefinitions().
Here is our stack trace:
[error] TypeError: uasort(): Argument #1 ($array) must be of type array, null given in uasort() (line 65 of /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php) #0 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php(65): uasort(NULL, Array) #1 /var/www/html/docroot/core/modules/field/field.module(414): Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getPluginId('node', 'entity_hierarch...') #2 [internal function]: field_field_config_create(Object(Drupal\field\Entity\FieldConfig)) #3 /var/www/html/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(409): call_user_func_array(Object(Closure), Array) #4 /var/www/html/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(388): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'field') #5 /var/www/html/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(408): Drupal\Core\Extension\ModuleHandler->invokeAllWith('field_config_cr...', Object(Closure)) #6 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(341): Drupal\Core\Extension\ModuleHandler->invokeAll('field_config_cr...', Array) #7 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(434): Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook('create', Object(Drupal\field\Entity\FieldConfig)) #8 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(357): Drupal\Core\Config\Entity\ConfigEntityStorage->_doCreateFromStorageRecord(Array, true) #9 /var/www/html/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(1059): Drupal\Core\Config\Entity\ConfigEntityStorage->importCreate('field.field.nod...', Object(Drupal\Core\Config\Config), Object(Drupal\Core\Config\Config)) #10 /var/www/html/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(842): Drupal\Core\Config\ConfigImporter->importInvokeOwner('', 'create', 'field.field.nod...') #11 /var/www/html/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(663): Drupal\Core\Config\ConfigImporter->processConfiguration('', 'create', 'field.field.nod...') #12 /var/www/html/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(561): Drupal\Core\Config\ConfigImporter->processConfigurations(Array) #13 /var/www/html/docroot/core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php(31): Drupal\Core\Config\ConfigImporter->doSyncStep('processConfigur...', Array) #14 /var/www/html/docroot/core/includes/batch.inc(296): Drupal\Core\Config\Importer\ConfigImporterBatch::process(Object(Drupal\Core\Config\ConfigImporter), 'processConfigur...', Array) #15 /var/www/html/docroot/core/includes/form.inc(974): _batch_process() #16 /var/www/html/docroot/core/includes/install.core.inc(660): batch_process(Object(Drupal\Core\Url), Object(Drupal\Core\Url)) #17 /var/www/html/docroot/core/includes/install.core.inc(578): install_run_task(Array, Array) #18 /var/www/html/docroot/core/includes/install.core.inc(121): install_run_tasks(Array, Array) #19 /var/www/html/vendor/drush/drush/includes/drush.inc(69): install_drupal(Object(Composer\Autoload\ClassLoader), Array, Array) #20 /var/www/html/vendor/drush/drush/includes/drush.inc(53): drush_call_user_func_array('install_drupal', Array) #21 /var/www/html/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(169): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array, Array) #22 [internal function]: Drush\Commands\core\SiteInstallCommands->install('minimal', Array) #23 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array) #24 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData)) #25 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData)) #26 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData)) #27 /var/www/html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #28 /var/www/html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #29 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #30 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #31 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #32 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput)) #33 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array) #34 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...') #35 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...') #36 {main}.
My proposal was to make sure plugin derivatives get created for every entity type, whether or not a field exists already, but I don't know enough about this module to understand why that will break things.
- Status changed to Needs work
7 months ago 3:02pm 20 February 2024 -
larowlan β
committed 3054055b on 3.x
Issue #3421731: drush site:install fails with entity hierarchy field in...
-
larowlan β
committed 3054055b on 3.x
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Merging the MR because it fixes tests. Back to the drawing board
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
but I don't know enough about this module to understand why that will break things.
The plugin expects tables/fields etc to exist in order to query the hierarchy
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I actually think this is a core issue, I think `field_field_config_create` should be checking if the config manager is syncing.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
larowlan β changed the visibility of the branch 3421731-drush-siteinstall-fails to hidden.
- Merge request !6728Resolve #3421731 "Fieldfieldconfigcreate should check" β (Open) created by larowlan
- Status changed to Needs review
7 months ago 11:38pm 21 February 2024 - Status changed to RTBC
7 months ago 10:29pm 23 February 2024 - πΊπΈUnited States smustgrave
Test coverage is shown here https://git.drupalcode.org/project/drupal/-/jobs/875136
Early return if syncing makes sense and simple enough that I think marking now is fine.
- Status changed to Fixed
6 months ago 10:13am 4 March 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Committed and pushed b32845ead7 to 11.x and 65e255676e to 10.3.x and f0738dc9ee to 10.2.x. Thanks!
-
alexpott β
committed f0738dc9 on 10.2.x
Issue #3421731 by larowlan, byrond: field_field_config_create should...
-
alexpott β
committed f0738dc9 on 10.2.x
-
alexpott β
committed 65e25567 on 10.3.x
Issue #3421731 by larowlan, byrond: field_field_config_create should...
-
alexpott β
committed 65e25567 on 10.3.x
-
alexpott β
committed b32845ea on 11.x
Issue #3421731 by larowlan, byrond: field_field_config_create should...
-
alexpott β
committed b32845ea on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.