0

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:

  1. In the Administration panel, I put the site in Maintenance mode

  2. Using Composer, I execute:

    composer update drupal/commerce --with-dependencies 
    
  3. Execute:

    php drush.php cache-rebuild
    
  4. Execute:

    php drush.php cc drush
    
  5. For the fun of it, I also cleared cache from the Admin panel.

  6. Checked Reports / Available updates. Address and Profile (ie, Commerce 2.0) have both been updated.

  7. 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.       
  • You need to run the db updates, either drush updatedb or /update.php – Patrick Kenny Oct 6 '17 at 16:29
0

1) Make sure you've run update.php

2) It is generally risky to go through a year of updates at once. Segmenting them (beta1 -> rc1, rc1 -> 2.0) is much safer.

3) The 2.0 release notes have a note about having to grant the "view products" permission to your user roles after updating.

  • I might have written the version down incorrectly - I started playing with Commerce in Aug, so I downloaded whatever Beta version was available at the time. The Drupal updates page says " 8.x-1.0-beta1" but that might not be correct. Where are you seeing the release notes about needing to grant "view products" permissions? I don't see it in on the Releases page (drupal.org/project/commerce/releases) nor is it in the new documentation site (docs.drupalcommerce.org), although much of it is still blank and is needing material. – marrer Oct 9 '17 at 16:01
  • drupal.org/project/commerce/releases/8.x-2.0 Linked from both the project page and the releases page. – Bojan Zivanovic Oct 10 '17 at 9:23
  • Must be more than that is needed, because once I did - yes, I could now see all of the products in my products view. But - when attempting to either add a product to the cart or view the cart itself, my site completely crashed! (sigh) Trying again today. I've lost track of how many hours I've spent in the past several weeks trying to get a simple 4-product site to work. Would be nice if an actual step-by-step example were in the documentation. – marrer Oct 10 '17 at 10:51
  • I also have a bug opened regarding the Authorize.Net interface (drupal.org/node/2914764). And my client is on my case wanting to go live this week. – marrer Oct 10 '17 at 10:52
  • Well, I think I finally have it working. Odd that I keep doing the same things and get different results. I'm only having problems now with the aforementioned AuthNet gateway, but that has been opened as a separate bug/issue. – marrer Oct 10 '17 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.