Fatal error: Declaration of Temando - Magento 2.3

Fatal error: Declaration of Temando - Magento 2.3

这是我第一次在这个社区上提出问题,每次都真的在救我的命。

现在我进入正题,因为我已经在整个互联网上搜索了这个,但没有结果 - 所以我希望这个 post 将来对其他人有用。

我在本地 127.0.0.1 中使用主题为 Porto 的 Magento 2.3,但是在默认和开发模式下我 运行 提示命令 php bin/magento setup:di:compile 我立即得到这个输出:

C:\xampp\htdocs\magento2>php bin/magento setup:di:compile Compilation was started. Repositories code generation... 1/7 [====>-----------------------] 14% 2 secs 54.0 MiBPHP Fatal error: Declaration of Temando\Shipping\Model\ResourceModel\CollectionPoint\OrderCollectionPointRepository::save(Temando\Shipping\Api\Data\CollectionPoint\OrderCollectionPointInterface $collectionPoint) must be compatible with Temando\Shipping\Model\ResourceModel\Repository\OrderCollectionPointRepositoryInterface::save(Temando\Shipping\Api\Data\Delivery\OrderCollectionPointInterface $collectionPoint) in C:\xampp\htdocs\magento2\vendor\temando\module-shipping-m2\Model\ResourceModel\CollectionPoint\OrderCollectionPointRepository.php on line 24

Fatal error: Declaration of Temando\Shipping\Model\ResourceModel\CollectionPoint\OrderCollectionPointRepository::save(Temando\Shipping\Api\Data\CollectionPoint\OrderCollectionPointInterface $collectionPoint) must be compatible with Temando\Shipping\Model\ResourceModel\Repository\OrderCollectionPointRepositoryInterface::save(Temando\Shipping\Api\Data\Delivery\OrderCollectionPointInterface $collectionPoint) in C:\xampp\htdocs\magento2\vendor\temando\module-shipping-m2\Model\ResourceModel\CollectionPoint\OrderCollectionPointRepository.php on line 24

我尝试禁用该模块,但没有任何反应; 我曾尝试通过作曲家 运行 从 Github 下载的 MageFix,但它对 Magento 2.3 不利(我认为)。

修复

根据 TGR_dev 的建议,这就是此错误的完整修复方法。

在 Vendor 文件夹中,我删除了 Temando 文件夹,然后我看到 Magento 停止工作了 - 这是正常的;

我按照本指南中的 "command line update" 重新安装了 Magento:https://blog.magestore.com/upgrade-magento-2-3/#a3

编辑

如果您上传了 MageFix,请务必将其从 app/code 文件夹中删除,否则会出现错误

希望对您有所帮助!

当我从 2.2.6 升级到 Magento 2.3.0 时,我遇到了同样的问题。解决方法:彻底删除vendor/temando文件夹和所有文件,然后重新安装Magento 2.3.0升级。这将安装新的 temando 文件夹和文件,而不会出现旧版不兼容错误。

转到 Magento 根 目录 > 供应商删除 Temando 文件夹。

现在从 Magento 网站下载 Magento 2.3.0 或您当前的 Magento 版本存档文件夹并复制 Vendor > Temando 文件夹最新下载的 Magento 并将其粘贴到您的供应商目录中..

使用cmd再次使用编译命令:

> php bin/magento setup:di:compile

它会起作用..