(looking through the issue queue, I did not see a similar issue) Trying to follow instructions at: http://docs.drupalcommerce.org/v2/getting-started.html
Getting an error (WSOD) in apache:
Error: Call to a member function getRequiredFields() on null in /Users/rkoberg/Sites/fwi/drupal/modules/contrib/address/src/Plugin/Field/FieldWidget/AddressDefaultWidget.php on line 355, referer: http://www.fwi.dev/admin/commerce/stores
Relevant code:
protected function addressElements(array $element, array $values) {
$address_format = $this->addressFormatRepository->get($values['country_code']);
$required_fields = $address_format->getRequiredFields(); // line 355
Putting in a print_r($values) results in:
Array ( [country_code] => AF [administrative_area] => [locality] => [dependent_locality] => [postal_code] => [sorting_code] => [address_line1] => [address_line2] => [organization] => [recipient] => )
Next I set up an Address format for the U.S (/admin/config/regional/address-formats/manage/US) and a Zone (/admin/config/regional/zones/manage/us), but still gt the same error. Any ideas how to fix?
More info: I initially followed the install instructions at: http://docs.drupalcommerce.org/v2/install.html
This failed at the install step 2 for an existing site: composer drupal-update; giving the terminal error:
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Script Drupal\Core\Composer\Composer::vendorTestCodeCleanup handling the post-package-update event terminated with an exception
[RuntimeException]
The directory 'tests' in package 'behat/mink' does not exist.
After some searches, the consensus seemed to be to install using the source:
$ composer update --prefer-source behat
This appeared to work, and brought down everything, but installed older versions than the non-source update tried to install (see bottom for terminal output). Next, completed the remaining step (composer dump-autoload;) and proceeded to step 3:
$ drupal module:install commerce_product commerce_order commerce_cart commerce_tax
Installing module(s) commerce_product, commerce_order, commerce_cart, commerce_tax, commerce, entity, commerce_price, commerce_store, inline_entity_form, profile, state_machine
[OK] The following module(s) were installed successfully: commerce_product, commerce_order, commerce_cart,
commerce_tax, commerce, entity, commerce_price, commerce_store, inline_entity_form, profile, state_machine
// settings:check
The extension mysql is recommended to install.
The configuration date.timezone was missing and overwritten with America/Tijuana.
// cache:rebuild
Rebuilding cache(s), wait a moment please.
[OK] Done clearing cache(s).
Terminal output for:
$ composer update --prefer-source behat
Package "behat" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing symfony/polyfill-mbstring (v1.1.1)
- Removing symfony/polyfill-apcu (v1.1.1)
- Removing composer/installers (v1.0.23)
- Installing composer/installers (v1.0.21)
Cloning d64e23fce42a4063d63262b19b8e7c0f3b5e4c45
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing wikimedia/composer-merge-plugin (v1.3.1)
- Installing wikimedia/composer-merge-plugin (v1.3.0)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/class-loader (v2.7.10)
- Installing symfony/class-loader (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/console (v2.7.10)
- Installing symfony/console (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/dependency-injection (v2.7.10)
- Installing symfony/dependency-injection (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/debug (v2.8.3)
- Installing symfony/debug (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/http-foundation (v2.7.10)
- Installing symfony/http-foundation (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/event-dispatcher (v2.7.10)
- Installing symfony/event-dispatcher (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/http-kernel (v2.7.10)
- Installing symfony/http-kernel (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/routing (v2.7.10)
- Installing symfony/routing (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/serializer (v2.7.10)
- Installing symfony/serializer (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/translation (v2.7.10)
- Installing symfony/translation (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/validator (v2.7.10)
- Installing symfony/validator (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/process (v2.7.10)
- Installing symfony/process (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing twig/twig (v1.24.0)
- Installing twig/twig (v1.23.1)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing doctrine/cache (v1.6.0)
- Installing doctrine/cache (v1.4.2)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing doctrine/inflector (v1.1.0)
- Installing doctrine/inflector (v1.0.1)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing doctrine/common (v2.5.3)
- Installing doctrine/common (v2.5.1)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing zendframework/zend-hydrator (1.1.0)
Cloning 22652e1661a5a10b3f564cf7824a2206cf5a4a65
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing zendframework/zend-stdlib (3.0.0)
- Installing zendframework/zend-stdlib (2.7.3)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing zendframework/zend-feed (2.7.0)
- Installing zendframework/zend-feed (2.5.2)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing egulias/email-validator (1.2.11)
- Installing egulias/email-validator (1.2.9)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing zendframework/zend-diactoros (1.3.3)
- Installing zendframework/zend-diactoros (1.1.3)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing composer/semver (1.3.0)
- Installing composer/semver (1.0.0)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing guzzlehttp/psr7 (1.2.3)
- Installing guzzlehttp/psr7 (1.2.0)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing guzzlehttp/promises (1.1.0)
- Installing guzzlehttp/promises (1.0.2)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing guzzlehttp/guzzle (6.1.1)
- Installing guzzlehttp/guzzle (6.1.0)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/dom-crawler (v3.0.3)
- Installing symfony/dom-crawler (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/css-selector (v2.7.10)
- Installing symfony/css-selector (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing symfony/browser-kit (v3.0.3)
- Installing symfony/browser-kit (v2.7.6)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing fabpot/goutte (v3.1.2)
- Installing fabpot/goutte (v3.1.1)
Downloading: 100%
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/intl (dev-master d975da2)
Cloning d975da224440180cfb97c9db135b53ec3ed52079
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/enum (v1.0)
Cloning 1d9db2dbeb1a02500e7a14589ae2f9cb402c5c95
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/addressing (dev-master 93ddf17)
Cloning 93ddf176d7dd851edb0bb05694ed1614c5c67ef8
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/zone (dev-master 1a690b7)
Cloning 1a690b7366a58cf3778b8ca440813d89a56204d4
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/pricing (dev-master fd1c8e6)
Cloning fd1c8e67d067c04da50780b90522e650e60bb543
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing commerceguys/tax (dev-master fcc7a9d)
Cloning fcc7a9d00ffc9f4e3c7e3a1883c61cb683fb7b6b
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
zendframework/zend-hydrator suggests installing zendframework/zend-eventmanager (^2.6.2 || ^3.0, to support aggregate hydrator usage)
zendframework/zend-hydrator suggests installing zendframework/zend-serializer (^2.6.1, to use the SerializableStrategy)
zendframework/zend-hydrator suggests installing zendframework/zend-servicemanager (^2.7.5 || ^3.0.3, to support hydrator plugin manager usage)
zendframework/zend-hydrator suggests installing zendframework/zend-filter (^2.6, to support naming strategy hydrator usage)
commerceguys/addressing suggests installing symfony/form (to generate Symfony address forms)
commerceguys/addressing suggests installing symfony/intl (to use it as the source of country data)
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
At the bottom of the output I see suggestions to install additional "things" like "symfony/form", but not really sure how to do that in this install process, if they are indeed needed.
Comments
Comment #2
bojanz commentedWelcome to our buggy world :)
This is a Drupal core bug, to be fixed when #2664274: Combination of --prefer-dist and .gitattributes confuses our vendor test cleanup lands.
The right way to fix the issue is to apply that patch, then rerun "composer drupal-update".
Anyway, looks like your workaround resulted in the libraries getting installed.
The other issue you're seeing is documented in the Address issue queue #2622446: Ensure address formats are always installed but so far nobody has provided enough information to track it down.
It seems that an install crash results in the address formats not being imported (you said you created a US address format, one should have already been present), which
causes the module to crash. I suggest uninstalling and re-installing the Address module (and the Commerce modules).
Comment #3
RobKoberg commentedThank you for the details. I applied the patch (#38 https://www.drupal.org/node/2664274#comment-10954323 ) and ran
composer drupal-update, but now get a different error:Not sure if this is a commerce specific issue (looks like it is core's) or if I should post this info at that issue?
Next I tried (from #34 in the referenced issue), which resulted in the same error, but with more info (tried both
composer update -vv --prefer-distandcomposer update -vv --prefer-sourcewith the same io error):Comment #4
alexpott@RobKoberg looking at the stack trace I'm confused... in I apply the patch in #2664274: Combination of --prefer-dist and .gitattributes confuses our vendor test cleanup to HEAD drupal line 213 on Compser.php is
if (strtolower($key) === $package_name) {- are you sure the patch is applied correctly and that your Composer.php contains no other changes?Comment #5
RobKoberg commentedIntellij IDEA told me the patch applied successfully. I hadn't touched it otherwise (or any other core files). However, the composer.json shows
"drupal/core": "~8.0",. So I am probably using the wrong drupal version for the patch? Apologies: just installed this yesterday to check out commerce in D8 and not very familiar with D8 et al.Comment #6
bojanz commentedThe core patch was committed, you can now install Commerce on tomorrow's -dev release of Core.
Sorry for the bumps in the road. I'm hoping they were the last ones, as far as Composer is concerned.