我刚从 3.1.17 升级到 4.1.1,我发现我的购物清单有问题。
当我到达 /customer/shoppinglist/5064 我看到这个:
查看生产中的日志文件,我看到:
[2020-06-23 17:42:56] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\UndefinedMethodError: "Attempted to call an undefined method named "getDigitalAsset" of class "Proxies\__CG__\Oro\Bundle\AttachmentBundle\Entity\File"." at /usr/share/nginx/html/oroapp/vendor/oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php line 47 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Attempted to call an undefined method named \"getDigitalAsset\" of class \"Proxies\\__CG__\\Oro\\Bundle\\AttachmentBundle\\Entity\\File\". at /usr/share/nginx/html/oroapp/vendor/oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php:47)"} []
我去看了代码,发现其实getDigitalAsset
oro/platform/src/Oro/Bundle/DigitalAssetBundle/Provider/FileTitleProvider.php里面没有方法,proxy里面也没有……怎么会这样?
我在我的虚拟机上检查了这个(问题没有发生),我看到代理类中有这个定义:
/**
* {@inheritDoc}
*/
public function getDigitalAsset()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getDigitalAsset', []);
return parent::getDigitalAsset();
}
但同样,我在父类中没有看到名为 getDigitalAsset 的方法。
我在升级时遇到了一些问题(我意识到我的 nodejs 没有像我想象的那样升级),这可能与问题有关吗?
谢谢
编辑:
我再次进行了平台升级,发现有一些问题导致它无法完全完成。
这是我发现的:
> loading Oro\Bundle\CMSBundle\Migrations\Data\ORM\LoadImageSlider
In LoadImageSlider.php line 117:
Attempted to call an undefined method named "setMainImage" of class "Oro\Bundle\CMSBundle\Entity\ImageSlide".
我注释掉了加载方法中的循环并重新运行升级。然后我得到:
> loading Oro\Bundle\CMSBundle\Migrations\Data\ORM\LoadImageSlider
In QueryException.php line 65:
[Semantical Error] line 0, col 117 near 'digitalAsset': Error: Class Oro\Bundle\AttachmentBundle\Entity\File has no association named digitalAsset
In QueryException.php line 43:
SELECT file, digitalAsset, sourceFile FROM Oro\Bundle\AttachmentBundle\Entity\File file INNER JOIN file.digitalAsset digitalAsset INNER JOIN digitalAsset.sourceFile sourceFile WHERE file.parentEntityClass = :parentEntityClass
AND file.parentEntityId = :parentEntityId AND file.parentEntityFieldName =
:parentEntityFieldName
终于可以通过注释掉整个 load 方法来完成升级了