doofinder / doofinder-magento2

Open Software License 3.0
10 stars 8 forks source link

Compatible with Magento 2.4.7 - Backward compatibility has been lost in the Magento\Catalog\Model\ProductRepository class #317

Closed TuVanDev closed 2 months ago

TuVanDev commented 2 months ago

As of Magento 2.4.7, backward compatibility has been lost in the Magento\Catalog\Model\ProductRepository class. This pull request aims to fix this issue.

Check the issue page in the Magento repo for reference: https://github.com/magento/magento2/issues/38669.

TuVanDev commented 2 months ago

It is worth saying that there is no need to check if the instance of theProductMetadataInterface interface contains the getVersion method, as this method always exists in Magento 2. You can refer to the code in the following links for confirmation: https://github.com/magento/magento2/blob/2.0/lib/internal/Magento/Framework/App/ProductMetadataInterface.php#L17 https://github.com/magento/magento2/blob/2.4.7/lib/internal/Magento/Framework/App/ProductMetadataInterface.php#L21

ihor-sviziev commented 2 months ago

Can you try removing constructor override and try something like this instead? https://github.com/magento/magento2/issues/30684#issuecomment-722602562