【发布时间】:2014-02-08 03:01:05
【问题描述】:
我已经修改了我的 joomla 最新新闻模块,通过将这些行添加到 helper.php 使其仅显示最近一个月的文章
$model->setState('filter.date_filtering', 'relative');
$model->setState('filter.relative_date', 30);
在我今天将我的 joomla 安装升级到最新的 Joomla 3.2.2 之前,它运行良好。 它适用于公共访问和注册用户,但是当我在前端以管理员用户身份登录时,它会返回空白输出,当我将错误报告设置为开发级别时,它会返回以下错误消息:
Notice: Undefined variable: nowDate in xxx/components/com_content/models/articles.php on line 471
Warning: Invalid argument supplied for foreach() in xxx/components/com_content/models/articles.php on line 546
Warning: Invalid argument supplied for foreach() in xxx/modules/mod_articles_latest/helper.php on line 105
Warning: Invalid argument supplied for foreach() in xxx/modules/mod_articles_latest/tmpl/default.php on line 13
当我查看 com_content/models/articles.php 并将其与旧的 3.2.1 版本进行比较时,我发现在 j 3.2.2 版本中添加了这一新行:
if ((!$user->authorise('core.edit.state', 'com_content')) && (!$user->authorise('core.edit', 'com_content'))) {
如果我删除这一行,那么一切都会恢复正常。
我的问题是,它是否被认为是 joomla 3.2.2 错误?如果不是,我如何修改模块代码以允许我只显示最近 30 个月的文章而不修改articles.php?
谢谢
【问题讨论】:
-
你破解了核心模块还是复制了它?
-
我破解了它。无论如何,这看起来像是一个 joomla 3.2.2 错误,因为我在 joomla 文章类别模块中发现了同样的问题
-
在这种情况下,我建议将其作为错误报告提交:joomlacode.org/gf/project/joomla/tracker/…