问题描述
当在织梦Dede中添加自定义图片字段时,前台打开当前栏目列表会出现以下错误:
Fatal error: Call to a member function GetInnerText() on string in /include/taglib/channel/img.lib.php on line 51
后台也会出现类似错误:
Fatal error: Call to a member function GetInnerText() on a non-object in /include/customfields.func.php on line 539
解决方法
-
编辑
customfields.func.php
文件- 打开
/include/customfields.func.php
文件。 - 找到以下代码:
$fvalue = trim($ntag->GetInnerText());
- 修改为:
$fvalue = ($ntag == "") ? trim($ntag) : trim($ntag->GetInnerText());
- 打开
-
编辑
img.lib.php
文件- 打开
/include/taglib/channel/img.lib.php
文件。 - 找到以下代码:
$innerTmp = $arcTag->GetInnerText();
- 修改为:
$innerTmp = ($arcTag == "") ? trim($arcTag) : trim($arcTag->GetInnerText());
- 打开