I had a basic store with four items working fine under 1.0-beta1. I wanted the newest 20 Sept 2017 official full release version, so I executed the command:
composer update drupal/commerce --with-dependencies
I cleared the cache and all appeared OK with no errors.
But when I go to the list of items (via a view I created) on the website itself nothing is displayed - even though when editing the view the preview shows all four of the products with descriptions and prices as expected.
What other steps did I need to take? Shouldn't the upgrade from beta1 to 2.0 be seamless using only the Composer update command? I checked the new documentation and didn't see anything else.
Here are more details as to what I run into when attempting to upgrade my Commerce 2 installation from Beta 1 to RC1.
When I check Reports / Available Updates, two modules are flagged::
a) Address 8.x-1.1 --- Recommended version: 8.x-1.2 (2017-Sep-20)
b) Profile 8.x-1.0-beta1 --- Recommended version: 8.x-1.0-rc1 (2017-Sep-19) [This is the main Commerce 2.0 module.]
Before I attempt the update, this is what I currently have set and what results I get:
My store is defined with four products. All products are displayed on the Shop link in the main navigation menu, and placing into the cart is done solely from there.
The "Shop" link is defined as a View: Online Store (Index D8 search index)
Key settings are:
Title
Title: Online Store
Format
Format: Unformatted list
Show: Fields
Fields
Product datasource: Body
Product datasource: Variations
Page settings
Path: /shop
Menu: Normal: Shop
Access: None
Pager
Use pager: Mini | Mini pager, 10 items
Now I begin the upgrade:
In the Administration panel, I put the site in Maintenance mode
Using Composer, I execute:
composer update drupal/commerce --with-dependencies
Execute:
php drush.php cache-rebuild
Execute:
php drush.php cc drush
For the fun of it, I also cleared cache from the Admin panel.
Checked Reports / Available updates. Address and Profile (ie, Commerce 2.0) have both been updated.
Took the site out of Maintenance Mode.
So I go to the website on a separate browser. Go to the online store page. No items are listed. Everything else is there: header & graphics, main navigation menu, sidebar, footer, etc. Just blank where the four products and their "Add to cart" buttons should be.
I go to Commerce / Products - all four products are listed. Nothing changed there.
I go to the Search API page and check the D8 search index. It says "4/4 indexed". For the fun of it I clear all indexed data and re-index. When done it again says "4/4 indexed", but refreshing the web page still shows nothing.
I go to the View for that page. All products show in the preview. I click to "Update preview" . All four products still are listed.
Yet the store page on the website still shows nothing.
So what am I missing? Why did the upgrade take place with no errors, all of my products are still listed, yet the web page / view does not show any of the products?
Update Sat Oct 7, 9:31 am
Per Patrick Kenny's comment I added the updatedb command, but the product page still does not display when completed. Here is my console session for review:
# composer update drupal/commerce --with-dependencies
Dependency "drupal/entity" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/entity" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/entity" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing drupal/address (1.1.0)
- Installing drupal/address (1.2.0)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Removing drupal/profile (1.0.0-beta1)
- Installing drupal/profile (1.0.0-rc1)
Loading from cache
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Updating drupal/commerce dev-2.x (7c2decc => 1118fcb)
Checking out 1118fcb2d9ddeb29b622a39391bb07d7bbc01674
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
Removing packages services cache file:
/home/xxxxxx/www.bbbbbbbb.com/vendor/drupal/console/extend.console.uninstall.services.yml
Creating packages services cache file:
/home/xxxxxx/www.bbbbbbbb.com/vendor/drupal/console/extend.console.uninstall.services.yml
# php drush.php updatedb -y
The following updates are pending:
commerce_order module :
8203 - Add the 'locked' field to 'commerce_order' entities.
commerce_product module :
8202 - Set the 'published' entity key.
8203 - Update the 'status' field.
commerce_order module :
Update the profile address field.
commerce_product module :
Expose the status field on every product form.
Do you wish to run all pending updates? (y/n): y
Performing commerce_product_update_8202 [ok]
Performing commerce_product_update_8203 [ok]
Performing commerce_order_update_8203 [ok]
Post updating commerce_order [ok]
Post updating commerce_product [ok]
Cache rebuild complete. [ok]
Finished performing updates. [ok]
# php drush.php cache-rebuild
Cache rebuild complete.
# php drush.php cc drush
'drush' cache was cleared.
In addition, someone on Drupal.org suggested that I also needed to run the entup command. I tried once again, but when running it I got these errors. Maybe they can provide a clue as to what else may be amiss on my site.
# php drush.php entup -y
The following updates are pending:
block_content entity type :
The block_content.field_select_a_form field needs to be updated.
Do you wish to run all pending updates? (y/n): y
Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aaaaaaa_bbbbbbb.bbbbbbb_block_content_revision__field_select_a_form' [error]
doesn't exist: SELECT 1 AS expression
FROM
{block_content_revision__field_select_a_form} t
WHERE field_select_a_form_target_id IS NOT NULL
LIMIT 1 OFFSET 0; Array
(
)
in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1485 of /home/xxxxxxxx/www.bbbbbbbb.com/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Failed: Drupal\Core\Entity\EntityStorageException: !message in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1485 of [error]
/home/xxxxxxxx/www.bbbbbbbb.com/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Cache rebuild complete. [ok]
Finished performing updates.
drush updatedb
or/update.php
– Patrick Kenny Oct 6 '17 at 16:29