when I enable commerce module, then prepare to enable commerce_store module, It reporte error as below:

The following module(s) will be enabled: commerce_store, commerce_price

 // Do you want to continue?: yes.                                              

TypeError: Argument 6 passed to Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget::__construct() must be an instance of CommerceGuys\Addressing\Country\CountryRepositoryInterface, instance of Drupal\address\Repository\CountryRepository given, called in /var/www/drupal/modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php on line 94 in /var/www/drupal/modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php on line 73 #0 /var/www/drupal/modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php(94): Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget->__construct('address_default', Array, Object(Drupal\Core\Field\BaseFieldDefinition), Array, Array, Object(Drupal\address\Repository\CountryRepository), Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher), Object(Drupal\Core\Config\ConfigFactory))
#1 /var/www/drupal/core/lib/Drupal/Core/Field/WidgetPluginManager.php(122): Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'address_default', Array)
#2 /var/www/drupal/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81): Drupal\Core\Field\WidgetPluginManager->createInstance('address_default', Array)
#3 /var/www/drupal/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('address_default')
#4 /var/www/drupal/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(148): Drupal\Component\Plugin\LazyPluginCollection->get('address_default')
#5 /var/www/drupal/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114): Drupal\Component\Plugin\LazyPluginCollection->getIterator()
#6 /var/www/drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(320): Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration()
#7 /var/www/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(266): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#8 /var/www/drupal/core/lib/Drupal/Core/Entity/EntityStorageBase.php(434): Drupal\Core\Entity\EntityDisplayBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#9 /var/www/drupal/core/lib/Drupal/Core/Entity/EntityStorageBase.php(389): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\Core\Entity\Entity\EntityFormDisplay))
#10 /var/www/drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(259): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\Core\Entity\Entity\EntityFormDisplay))
#11 /var/www/drupal/core/lib/Drupal/Core/Entity/Entity.php(390): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\Core\Entity\Entity\EntityFormDisplay))
#12 /var/www/drupal/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(637): Drupal\Core\Entity\Entity->save()
#13 /var/www/drupal/core/lib/Drupal/Core/Config/ConfigInstaller.php(330): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#14 /var/www/drupal/core/lib/Drupal/Core/Config/ConfigInstaller.php(133): Drupal\Core\Config\ConfigInstaller->createConfiguration('', Array)
#15 /var/www/drupal/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php(75): Drupal\Core\Config\ConfigInstaller->installDefaultConfig('module', 'commerce_store')
#16 /var/www/drupal/core/lib/Drupal/Core/Extension/ModuleInstaller.php(268): Drupal\Core\ProxyClass\Config\ConfigInstaller->installDefaultConfig('module', 'commerce_store')
#17 /var/www/drupal/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#18 /var/www/drupal/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php(79): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#19 [internal function]: Drush\Drupal\Commands\pm\PmCommands->enable(Array, Array)
#20 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(235): call_user_func_array(Array, Array)
#21 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#22 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(150): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#23 /var/www/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#24 /var/www/drupal/vendor/symfony/console/Command/Command.php(252): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/drupal/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/drupal/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/drupal/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#30 /var/www/drupal/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#31 /var/www/drupal/vendor/drush/drush/drush(4): require('/var/www/drupal...')
#32 {main}
TypeError: Argument 6 passed to Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget::__construct() must be an instance of CommerceGuys\Addressing\Country\CountryRepositoryInterface, instance of Drupal\address\Repository\CountryRepository given, called in /var/www/drupal/modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php on line 94 in Drupal\address\Plugin\Field\FieldWidget\AddressDefaultWidget->__construct() (line 73 of /var/www/drupal/modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php).
 [error]  Drush command terminated abnormally due to an unrecoverable error. 

CommentFileSizeAuthor
#2 2975632-address-2.patch7.96 KBjohn.nie

Comments

john.lee created an issue. See original summary.

john.nie’s picture

john.nie’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 2975632-address-2.patch, failed testing. View results

bojanz’s picture

Category: Bug report » Support request
Priority: Critical » Normal
Status: Needs work » Active

This patch doesn't make sense. Address is not using commerceguys/intl in any way anymore, the Addressing namespaces are correct.

This smells like a version mismatch on your end, make sure you've updated Address using "composer update drupal/address --with-dependencies". The "composer show | grep 'commerceguys/addressing'" command should show addressing v1.0.0, not an older beta.

john.nie’s picture

Hi, @bojanZ, I am using 1.4, and I composer update drupal/address, but it show:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Updating doctrine/collections (v1.3.0 => v1.5.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

address has not anything to update, so, I think, it is adopted with currently 8.x-1.4 be usefully,
maybe you have update address in dev, I hope soon will get it.

thks.

bojanz’s picture

You always need --with-dependencies, that updates the underlying library. This is documented on the project page.

john.nie’s picture

WARNING: [pool www] child 214 said into stderr: "NOTICE: PHP message: TypeError: Argument 1 passed to Drupal\address\Plugin\Validation\Constraint\CountryConstraintValidator::__construct() must be an instance of CommerceGuys\Addressing\Country\CountryRepositoryInterface, instance of Drupal\address\Repository\CountryRepository given, called in /var/www/drupal/modules/contrib/address/src/Plugin/Validation/Constraint/CountryConstraintValidator.php on line 37 in /var/www/drupal/modules/contrib/address/src/Plugin/Validation/Constraint/CountryConstraintValidator.php on line 29 #0 /var/www/drupal/modules/contrib/address/src/Plugin/Validation/Constraint/CountryConstraintValidator.php(37): Drupal\address\Plugin\Validation\Constraint\CountryConstraintValidator->__construct(Object(Drupal\address\Repository\CountryRepository))"

when store edit page, save entity, it reported this error, http response 500 status code.

I justed update address/src/Plugin/Validation/Constraint/CountryConstraintValidator.php CountryRepositoryInterface from addressing to intl, this error is fixed.

it's same with this error.
but, it fixed.

bojanz’s picture

#8 is the same error as in the original comment, with the same cause (a problem in your install caused by an older commerceguys/addressing release).

bojanz’s picture

Status: Active » Closed (cannot reproduce)