首页 > 建站教程 > CMS教程 > dedecms >  dedecms织梦:Call to a member function GetInnerText() 报错正文

dedecms织梦:Call to a member function GetInnerText() 报错

我爱模板网在用dedecms给客户做网站时,新建了个栏目,添加文章时一切正常,但是,当再此打开这个文章进行编辑时,就出现了下面的错误:

Fatal error: Uncaught Error: Call to a member function GetInnerText() on string in /www/wwwroot/www.5imoban.net/include/customfields.func.php:539 Stack trace: #0 /www/wwwroot/www.5imoban.net/woaimoban/inc/inc_archives_functions.php(560): GetFormItemValue(Object(DedeTag), '', 'admin') #1 /www/wwwroot/www.5imoban.net/woaimoban/inc/inc_archives_functions.php(615): GetFormItemValueA(Object(DedeTag), '') #2 /www/wwwroot/www.5imoban.net/woaimoban/templets/archives_edit.htm(195): PrintAutoFieldsEdit('<field:flashpic...', Array) #3 /www/wwwroot/www.5imoban.net/woaimoban/archives_edit.php(50): include('/www/wwwroot/ww...') #4 {main} thrown in /www/wwwroot/www.5imoban.net/include/customfields.func.php on line 539

结合网上的方法,需要修改两处,即可解决问题(之前没有出现这种情况,换成了php 7就出现了,应该是之前的dedecms织梦版本问题):
1、打开/inculde/taglib/channel/img.lib.php,找到51行所在的代码,
$innerTmp = $arcTag->GetInnerText();
替换为:
$innerTmp = ($arcTag=="") ? trim($arcTag) : trim($arcTag->GetInnerText());
2、打开/include/customfields.func.php,找到539行:
$fvalue = trim($ntag->GetInnerText());
替换为:
$fvalue = $ntag=="" ? trim($ntag) : trim($ntag->GetInnerText());
完成上面两步,问题解决