Problem/Motivation

So first off, the "billwerk_subscriptions_entities" has an undocumented dependency on fences, through "core.entity_view_display.billwerk_plan.billwerk_plan.default.yml". Is that intended?

But now to the main point. When installing the "billwerk_subscriptions_entities", the following error appears:

[warning] Undefined array key "third_party_settings" EntityReferenceEntityFormatter.php:109
[error] TypeError: Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::__construct(): Argument #7 ($third_party_settings) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php on line 102 in Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter->__construct() (line 91 of /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php) #0 /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php(102): Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter->__construct('entity_referenc...', Array, Object(Drupal\field\Entity\FieldConfig), Array, 'hidden', 'default', NULL, Object(Drupal\Core\Logger\LoggerChannelFactory), Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Entity\EntityDisplayRepository))
#1 /var/www/html/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php(64): Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'entity_referenc...', Array)
#2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81): Drupal\Core\Field\FormatterPluginManager->createInstance('entity_referenc...', Array)
#3 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('entity_referenc...')
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(149): Drupal\Component\Plugin\LazyPluginCollection->get('entity_referenc...')
#5 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114): Drupal\Component\Plugin\LazyPluginCollection->getIterator()
#6 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(295): Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration()
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(270): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#8 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\Core\Entity\EntityDisplayBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#9 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\Core\Entity\Entity\EntityViewDisplay))
#10 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(257): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\Core\Entity\Entity\EntityViewDisplay))
#11 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\Core\Entity\Entity\EntityViewDisplay))
#12 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(609): Drupal\Core\Entity\EntityBase->save()
#13 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php(389): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#14 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php(149): Drupal\Core\Config\ConfigInstaller->createConfiguration('', Array)
#15 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php(75): Drupal\Core\Config\ConfigInstaller->installDefaultConfig('module', 'billwerk_subscr...')
#16 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(334): Drupal\Core\ProxyClass\Config\ConfigInstaller->installDefaultConfig('module', 'billwerk_subscr...')
#17 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#18 /var/www/html/vendor/drush/drush/src/Commands/pm/PmCommands.php(102): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#19 [internal function]: Drush\Commands\pm\PmCommands->install(Array, Array)
#20 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
#21 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#22 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#23 /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))
#24 /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))
#25 /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))
#26 /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))
#27 /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))
#28 /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))
#29 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
#31 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
#32 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...')
#33 {main}.
TypeError: Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::__construct(): Argument #7 ($third_party_settings) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php on line 102 in /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php on line 91 #0 /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php(102): Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter->__construct('entity_referenc...', Array, Object(Drupal\field\Entity\FieldConfig), Array, 'hidden', 'default', NULL, Object(Drupal\Core\Logger\LoggerChannelFactory), Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Entity\EntityDisplayRepository))
#1 /var/www/html/web/core/lib/Drupal/Core/Field/FormatterPluginManager.php(64): Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'entity_referenc...', Array)
#2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81): Drupal\Core\Field\FormatterPluginManager->createInstance('entity_referenc...', Array)
#3 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('entity_referenc...')
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(149): Drupal\Component\Plugin\LazyPluginCollection->get('entity_referenc...')
#5 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114): Drupal\Component\Plugin\LazyPluginCollection->getIterator()
#6 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(295): Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration()
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(270): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#8 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\Core\Entity\EntityDisplayBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#9 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\Core\Entity\Entity\EntityViewDisplay))
#10 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(257): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\Core\Entity\Entity\EntityViewDisplay))
#11 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\Core\Entity\Entity\EntityViewDisplay))
#12 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(609): Drupal\Core\Entity\EntityBase->save()
#13 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php(389): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#14 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php(149): Drupal\Core\Config\ConfigInstaller->createConfiguration('', Array)
#15 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php(75): Drupal\Core\Config\ConfigInstaller->installDefaultConfig('module', 'billwerk_subscr...')
#16 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(334): Drupal\Core\ProxyClass\Config\ConfigInstaller->installDefaultConfig('module', 'billwerk_subscr...')
#17 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#18 /var/www/html/vendor/drush/drush/src/Commands/pm/PmCommands.php(102): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#19 [internal function]: Drush\Commands\pm\PmCommands->install(Array, Array)
#20 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
#21 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#22 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#23 /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))
#24 /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))
#25 /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))
#26 /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))
#27 /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))
#28 /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))
#29 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
#31 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
#32 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...')
#33 {main}
TypeError: Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::__construct(): Argument #7 ($third_party_settings) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php on line 102 in Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter->__construct() (line 91 of /var/www/html/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php).
[warning] Drush command terminated abnormally.
Failed to run drush en billwerk_subscriptions_entities: exit status 1

Steps to reproduce

Proposed resolution

Make the module installable.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Grevil created an issue. See original summary.

grevil’s picture

This might be an issue, in how view display config entities installed through this module (e.g. "core.entity_view_display.billwerk_component.billwerk_component.card_buy.yml") define their "content" properties:

1.
Every "normal" property has a "type" defined, expect our special "billwerk_subscriptions_entities_saas_fee_price_per_month" and "billwerk_subscriptions_entities_subscribe_button", shouldn't they atleast define a custom type?

2.
Properties like "label" define a "third_party_settings" section. I doubt that a property of the type "string" needs to provide any third_party_settings? Seems quite weird to me

NOTE, that the error appears, but the module still installs anyway!

grevil’s picture

Assigned: Unassigned » anybody

@Anybody, what do you think? This is now blocking #3442075: Fix schema and other test issues.

Anybody made their first commit to this issue’s fork.

anybody’s picture

Status: Active » Needs work

Here we go. The existing issue fork was broken, so I created a new one.
I removed the unwanted dependencies, but there's still one view that we need to modify to use a Drupal core style. It has been accidentally exported with a foundation style.

I'll try to fix this now.

Anybody changed the visibility of the branch 3441025-enabling-the-billwerksubscriptionsentities to hidden.

anybody’s picture

Ok we're finally back at the mentioned error now!

And this is the only result I found for this:

#3424732: Error when creating a new entity reference field but the fix looks strange and unrelated? Can we learn anything from that?

Anybody changed the visibility of the branch 1.x to hidden.

anybody’s picture

@Grevil: I have no more idea... I think we need to go into /web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php:109 and debug the values there to see why this happens.

Other issues fixed.

anybody’s picture

Assigned: anybody » grevil

@Grevil can you reproduce this locally in DDEV and check #10?

grevil’s picture

Interesting, $configuration['third_party_settings'] is simply not set:
screenshot

Instead, it is a sub entry of "field_definition".

grevil’s picture

Assigned: grevil » Unassigned

Yea, I am out of ideas as well. No idea, where we need to define these third party settings. I tried to add them to every single config.yml except the storage ones, but this doesn't seem to fix the issue...

anybody’s picture

Status: Needs work » Reviewed & tested by the community

Nice! We got it! :)

anybody’s picture

Assigned: Unassigned » grevil

Needs rebase

grevil’s picture

Assigned: grevil » Unassigned
Status: Reviewed & tested by the community » Fixed

All done, thx!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.