Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error upgrading module from 8.1.10 to 9.0.0 #77

Open
subbu1993 opened this issue Apr 27, 2021 · 2 comments
Open

Error upgrading module from 8.1.10 to 9.0.0 #77

subbu1993 opened this issue Apr 27, 2021 · 2 comments

Comments

@subbu1993
Copy link

Pre-requisites

BV current version - 8.1.10
BV Updated version 9.0.0.

Issue

The 8.1.10 version does not have the bv_feed_include attribute, it is still called bv_feed_exclude

The setup scripts for version 9.0.0 first tries to add a note on the non-existent bv_feed_include attribute

if (version_compare($context->getVersion(), '8.1.11') < 0) {
/** @var CategorySetup $eavSetup */
$eavSetup = $this->categorySetupFactory->create(['setup' => $setup]);
$entityTypeId = $eavSetup->getEntityTypeId(Product::ENTITY);
$eavSetup->updateAttribute(
$entityTypeId,
ProductFeed::INCLUDE_IN_FEED_FLAG,
'note',
'Not applicable to DCC'
);
}

before it can actually rename the attribute to bv_feed_include

if ($eavSetup->getAttribute($entityTypeId, 'bv_feed_exclude')) {
$eavSetup->updateAttribute(
$entityTypeId,
'bv_feed_exclude',
'attribute_code',
'bv_feed_include' //just fixes the code to reflect that it's been used as an include flag for years
);
}

This causes an error during setup:upgrade attribute bv_feed_include does not exist

Resolution

  1. Move the rename to above the check for 8.11.0
    (or)
  2. check in the 8.11.0 script if the bv_feed_include attribute exists

I can contribute a PR if you have a preferred approach. I personally prefer 1

@jantzenw
Copy link
Contributor

Hi,

Thank you for bringing this to our attention. We've just pushed up a likely fix for this issue in the master branch, seen here: 986eec8

If you can install the master branch version of the extension, please do so and let us know if the above resolves the issue. Otherwise, this change will be in the next release.

Alternatively you can install and upgrade to, say, 8.3.5, and then after that, install and upgrade to 9.0.0. But that may not be feasible with long release schedules.

@drew7721
Copy link

https://i.imgur.com/oOG9cKk.png

Upgrading from 8.1.10 to 9.0.0 still errors out.

I don't believe the commit mentioned above fixed anything. The fact is that you're assuming these attributes to be there.
Unfortunately, this is not always the case. Maybe they were removed, maybe they were moved.

You should ALWAYS check if the attribute exists or not, kind of like what is done on this line.

if ($eavSetup->getAttribute($entityTypeId, 'bv_feed_exclude')) {

See this patch file for an example that would work.
bazaarvoice.txt

Let me know, I can make a PR need be.

jochhop pushed a commit to jochhop/magento2-extension that referenced this issue Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants