Closed (fixed)
Project:
Commerce Pricelist
Version:
8.x-2.0-rc1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2020 at 14:53 UTC
Updated:
6 Feb 2020 at 01:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jsacksick commented"The update does not work correctly with Commerce 2.16" => which update?
Comment #3
zenimagine commented@jsacksick The entity update as you can see in the screenshot. It is no longer possible to use drush to do this. How to correct errors ? Thank you
Comment #4
bojanz commentedWe don't know how this happened, so we can't be of much help.
You might need to use https://www.drupal.org/project/devel_entity_updates to fix it.
If you manage to find a concrete cause, and/or write a patch for it, please reopen the issue.
Comment #5
zenimagine commented@bojanz This happened right after updating to Commerce 2.16 and Commerce Marketplace.
With each update, I always have a problem.
Comment #6
bojanz commentedI understand. And that problem is caused either by Marketplace or the way you update your site. We ourselves have no problem on dozens of sites we update.
So, please reopen the issue once you can provide a fix or pointers to a problematic part in code. There's nothing more we can do for you with the given information.
Comment #7
jsacksick commentedWell, I actually could reproduce this too, and this seems to be caused by this commit: https://git.drupalcode.org/project/commerce_pricelist/commit/79b1a90.
Unfortunately, we cannot just call the
updateEntityType()method on the entity definition update manager (An EntityStorageException is thrown when trying to do that with the following message: "'It is not possible to change the entity type schema outside of a batch context. Use EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() instead.'").The attached patch fixes the issue for me locally though.
@zenimagine: Could you confirm if works on your side as well?
Comment #8
mglamanI'm slightly considered about manually setting the installed schema instead of calling install/update fields or EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() so specifically.
That method should be reentrant
Comment #9
zenimagine commentedThanks, I tested the patch and it fixes the errors
Comment #10
jsacksick commented@zenimagine: Thank you for testing that, FYI, an other update hook was introduced already in dev for #3102979: Add a uid field to pricelist and price list items, if you ran "commerce_pricelist_update_8204", on your site then "commerce_pricelist_update_8203" isn't going to be executed and you'd be left without a "uid" field.
Committed.
Comment #12
jsacksick commentedComment #13
zenimagine commented@jsacksick On my production site, I have the RC1 version and I have not applied any patches.
What should I do to not break anything ? Thank you
Comment #14
zenimagine commented@jsacksick The patch worked on my test site.
As you told me, I did not apply the patch and I updated my production site to the DEV version of the module. But that does not correct, I still have the errors in the dashboard.
ubuntu@www-example-com /var/www/www-example-com $ composer require 'drupal/commerce_pricelist:2.x-dev'
./composer.json has been updated
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles
ubuntu@www-example-com /var/www/www-example-com $ drush updatedb
-------------------- ----------- --------------- -----------------------------
Module Update ID Type Description
-------------------- ----------- --------------- -----------------------------
commerce_pricelist 8202 hook_update_n Define event handlers for
price list and price list
items.
commerce_pricelist 8203 hook_update_n Add a 'uid' field to price
lists and price list items.
commerce_pricelist 8204 hook_update_n Fix the entity definition
mismatch caused by the
"data_table" key removal.
-------------------- ----------- --------------- -----------------------------
Comment #15
jsacksick commented@zenimagine: The attached patch should fix the issue.
However, I'm not 100% sure I should commit this since I already committed a fix to
commerce_pricelist_update_8203()which means the issue shouldn't occur on sites that will upgrade to the next RC, on using the current dev version.The issue should occur if you've updated to commerce price list dev, prior to this commit: https://git.drupalcode.org/project/commerce_pricelist/commit/cc861e98dbb...
Do you know if that's what you did?
Comment #16
zenimagine commented@jsacksick Thanks, the patch works. I applied the patch with the DEV version, updated the database and removed the patch. So it's good, the RC5 won't be a problem?