我的知识记录

请问织梦Dede自定义图片字段报错 Call to a member function GetInnerText()

问题描述

当在织梦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

解决方法

  1. 编辑 customfields.func.php 文件

    • 打开 /include/customfields.func.php 文件。
    • 找到以下代码:     $fvalue = trim($ntag->GetInnerText());
    • 修改为:     $fvalue = ($ntag == "") ? trim($ntag) : trim($ntag->GetInnerText());
  2. 编辑 img.lib.php 文件

    • 打开 /include/taglib/channel/img.lib.php 文件。
    • 找到以下代码:     $innerTmp = $arcTag->GetInnerText();
    • 修改为:     $innerTmp = ($arcTag == "") ? trim($arcTag) : trim($arcTag->GetInnerText());

 

标签:织梦自定义字段-织梦怎么用-织梦怎么改logo-织梦怎么生成移动端-织梦currentstyle-

更新时间:2025-04-11 01:12:22

上一篇:请问系统磁盘占满处理

下一篇:请问服务器端口未开启导致网站无法访问