magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Product edit breaks after upgrade from 2.0.6 to 2.1.5 #7319

Closed xaiamedia closed 6 years ago

xaiamedia commented 7 years ago

Preconditions

  1. PHP Version 7.0.12
  2. Magento 2.1.2

Steps to reproduce

  1. Having an perfect working 2.0.6 working shop
  2. Upgrade from 2.0.6 via commandline to 2.1.2
  3. Login to admin
  4. Go to catalog
  5. Pick a product and click edit
  6. First problem we've challenged was this error: Exception #0 (ReflectionException): Class Magento\Catalog\Block\Adminhtml\Product\Helper\Form\BaseImage does not exist
  7. Fixed by changing in the catalog_eav_attribute table entries with Magento\Catalog\Block\Adminhtml\Product\Helper\Form\BaseImag‌​e to Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Imag‌​e (somehow the class name has changed from BaseImage to Image in 2.1.2, found that by looking in the vendor path)
  8. Next another error shows up while trying to edit a product Exception #0 (InvalidArgumentException): Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery doesn'n extend \Magento\Framework\Data\Form\Element\AbstractElement

Expected result

  1. Edit product page

Actual result

  1. Exception: Exception #0 (InvalidArgumentException): Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery doesn'n extend \Magento\Framework\Data\Form\Element\AbstractElement
brideo commented 7 years ago

+1 also seeing this

carfantasy commented 7 years ago

Hi,

I have the same problem. How did you fix this?

Regards.

xaiamedia commented 7 years ago

I didn't, still waiting on a answer or fix from the magento staff. We reverted back to 2.0.6

carfantasy commented 7 years ago

Ok, did you import your products from an other shop? We have contact the Magento Develop team and they told me the problem came from the import, but iI'm not so sure about this.

I found this about the problem:

Issue 2: Unable to Add/Edit Catalog product from Admin

The Catalog screen doesn’t load when you try to edit or add the project. If you looked at the log then you get following exception:

Class media_image does not exist

Solution: The issue is due to custom attribute is not set by migration tool and can be fixed by running finding the attribute id of the image and run the following queries(in our case Attribute Ids were 106,109):

update catalog_eav_attribute set catalog_eav_attribute.frontend_input_renderer='Magento\Catalog\Block\Adminhtml\Product\Helper\Form\BaseImage' where catalog_eav_attribute.attribute_id in (106,109)

After running the query, run the following command:

php bin/magento indexer:reindex && php bin/magento cache:clean

carfantasy commented 7 years ago

Hi,

I just checked that table but this table looks fine. The value to entity look correctly filled.

What was wrong with this table in your case? Was it empty?

carfantasy commented 7 years ago

Ok, my catalog_product_entity_media_gallery_value looks good, but I have 2062111 records in it. So I can't check all records manually ;-)

Did you also had problems to Add new products? Like in this post on the top?

brideo commented 7 years ago

Sorry I've mixed up Github issues on this one!

carfantasy commented 7 years ago

When I try to sort this table catalog_product_entity_media_gallery_value in phpmyadmin it gives a time-out: Server time-out 504 So, Maybe there is a wrong index on this table or it's just to big.... Does anyone has an idea?

oshmyheliuk commented 7 years ago

Hi @xaiamedia Please give more details about how you made an upgrade from 2.0.6 to 2.1.2. Did you run setup:upgrade command after upgrade? I tried to reproduce, but edit product works as expected, without exceptions

oshmyheliuk commented 7 years ago

When I try to sort this table catalog_product_entity_media_gallery_value in phpmyadmin it gives a time-out: Server time-out 504 So, Maybe there is a wrong index on this table or it's just to big.... Does anyone has an idea?

@carfantasy it depends on which columns you want to sort a table. And maybe you try to fetch all records, you must use LIMIT statement in your sql queries.

carfantasy commented 7 years ago

Ok, thanks. But I still have this problem. I can not edit or add a product. Also see my issue #6904

maksymcherevko commented 7 years ago

Hi,

Have the same issue (versions 2.1.1 and 2.1.2). Reproduced in the same way as described by @xaiamedia

Run php bin/magento setup:upgrade

First exception:

1 exception(s):
Exception #0 (ReflectionException): Class media_image does not exist

After update column frontend_input_renderer by new value 'Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Image' (in table catalog_eav_attribute) i get the second exception:

1 exception(s):
Exception #0 (InvalidArgumentException): Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery doesn'n extend \Magento\Framework\Data\Form\Element\AbstractElement
xaiamedia commented 7 years ago

@oshmyheliuk I had upgraded the 2.0.6 composer file to 2.1.2. (require), ran the composer update command and then setup:upgrade via command line. After that I've cleant the cache, static files, ran setup:upgrade again to make sure. After that the issues appeared.

I did not found the solution yet, we're waiting untill the fix for our production environment. Still using 2.0.6. at this moment.

xaiamedia commented 7 years ago

Now an half year later.. we are willing to try the update again. This time 2.0.6. to 2.1.5. and still having the same issue?!

Why does no one pick this up? More people as you can read having this same issue!

danielozano commented 7 years ago

Same situation here. Any update on this? Maybe a year is not enough.

magento-engcom-team commented 6 years ago

@xaiamedia, thank you for your report. We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue. We tested the issue on 2.2.0, 2.1.9