gpt4 book ai didi

magento2 - 关于将 magento 升级到 2.3.0 的 Tinytext 问题

转载 作者:行者123 更新时间:2023-12-04 16:36:38 25 4
gpt4 key购买 nike

在 Magento 中,我网站的当前版本是 magento 2.2.5。现在我已将其更新到最新版本 magento 2.3.0 。但是当我运行时出现错误

php bin/magento setup:upgrade

我收到了这个错误

Cannot process definition to array for type tinytext

请建议我解决方案。谢谢你

最佳答案

您收到此错误是因为任何第三方扩展程序的表格列的“数据类型”是 tinytext

因此,您需要在以下文件中使用 debug 找出列名。

打开这个文件 /vendor/magento/framework/Setup/Declaration/Schema/Db/DefinitionAggregator.php 并检查这个 fromDefinition() 方法,然后添加调试代码查找列名。

public function fromDefinition(array $data)
{
$type = $data['type'];
if (!isset($this->definitionProcessors[$type])) {

/* Add Code for Debug */

echo "<pre>";
print_r($data); exit();

/* Code End */

throw new \InvalidArgumentException(
sprintf("Cannot process definition to array for type %s", $type)
);
}

$definitionProcessor = $this->definitionProcessors[$type];
return $definitionProcessor->fromDefinition($data);
}

之后请运行 setup:upgrade 命令,您将在控制台中获取列数据数组。所以从这个数组中你会得到你的第三方扩展表的列名。

现在请从该表中将列的数据类型“tinytext”更改为“text”,问题将得到修复。

注意:您也可能会遇到 ENUM 和 MEDIUMINT 数据类型的问题,因此如果遇到任何其他数据类型问题,请执行相同的步骤。

关于magento2 - 关于将 magento 升级到 2.3.0 的 Tinytext 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53540708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com