netresearch / dhl-shipping-m2

DHL multi-division shipping extension for Magento 2
Open Software License 3.0
13 stars 4 forks source link

Remove references to Zend_Measure_Weight #59

Closed sanderjongsma closed 3 weeks ago

sanderjongsma commented 10 months ago

Hi there, Can you please remove all references to Zend_Measure_Weight and replace with vendor/magento/framework/Measure/Weight.php. Currently Magento is forcing out all Zend related classes and is migrating to Laminas. But in you case all weight references can be found in the Weight class of magento.

If this is fixed the composer requirement to magento/zendframework1 can be removed in the composer.json also. Magento also doesn't use this requirement anymore, only for dev usage.

The reason for this issue is that your module now gives a lot of warnings during composer install like this:

Warning: Ambiguous class resolution, "Zend_Cache_Backend" was found in both "/data/plutosport/magento2/vendor/magento/zend-cache/library/Zend/Cache/Backend.php" and "/data/plutosport/magento2/vendor/magento/zendframework1/library/Zend/Cache/Backend.php", the first will be used.
Warning: Ambiguous class resolution, "Zend_Cache_Manager" was found in both "/data/plutosport/magento2/vendor/magento/zend-cache/library/Zend/Cache/Manager.php" and "/data/plutosport/magento2/vendor/magento/zendframework1/library/Zend/Cache/Manager.php", the first will be used.
Warning: Ambiguous class resolution, "Zend_Db" was found in both "/data/plutosport/magento2/vendor/magento/zend-db/library/Zend/Db.php" and "/data/plutosport/magento2/vendor/magento/zendframework1/library/Zend/Db.php", the first will be used.
mam08ixo commented 10 months ago

Hi @sanderjongsma, thank you for your request.

We aim to provide backwards compatibility with the active/maintained Magento versions. We need to discuss internally when the migration to the Zend replacement packages, that come shipped with M2.4.6, is a viable option.

Thank you

sanderjongsma commented 10 months ago

Thanks @mam08ixo glad to hear you will discuss this internally, keep me posted.

mam08ixo commented 10 months ago

After diving a little deeper into the topic, the situation is as follows:

The Zend_* classes that we use throughout the packages were moved to magento/framework and various magento/zend-* packages in 2.4.6. While the latter can also be installed on 2.4.5 (leading to the same warning message when generating autoload files there), the former is simply not available on 2.4.5.

That means that, as long as we support M2.4.5, the requested change will not be made. The earliest date for us to drop 2.4.5 support is general availability of 2.4.7 – the latest date is end of software support for 2.4.5 (Adobe Commerce lifecycle policy).

Since the warning message is an annoyance but does not break things, we hope for your understanding. Thank you for bringing this topic to our attention.

Sebastian80 commented 3 weeks ago

Hi @sanderjongsma,

This was done with Release 2.11.0