【问题标题】:Joomla 3.2.2 issue: Notice: Undefined variable: nowDate /components/com_content/models/articles.phpJoomla 3.2.2 问题:注意:未定义变量:nowDate /components/com_content/models/articles.php
【发布时间】: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 joomla3.2


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-24
  • 1970-01-01
  • 2021-03-07
相关资源
最近更新 更多