Joomla 3.2.2 问题:注意:未定义变量:nowDate/components/com_content/models/articles.php [英] Joomla 3.2.2 issue: Notice: Undefined variable: nowDate /components/com_content/models/articles.php

查看:17
本文介绍了Joomla 3.2.2 问题:注意:未定义变量:nowDate/components/com_content/models/articles.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经修改了我的 joomla 最新新闻模块,通过将这些行添加到 helper.php 使其仅显示最近一个月的文章

I have modified my joomla latest news module to make it displaying only articles from the latest month by adding these lines to the helper.php

$model->setState('filter.date_filtering', 'relative');
$model->setState('filter.relative_date', 30);

它运行良好,直到我今天将我的 joomla 安装升级到最新的 Joomla 3.2.2.它适用于公共访问和注册用户,但是当我在前端以管理员用户身份登录时,它返回一个空白输出,当我将错误报告设置为开发级别时,它返回这些错误消息:

It works good until I upgraded my joomla installation to the latest Joomla 3.2.2 today. It works properly for public access and registered user, but when I login as a admin user in the frontend it returns a blank output and when I set the error reporting to the development level it returns these error messages :

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 版本中添加了这条新行:

When I looked at the com_content/models/articles.php, and comparing it with the old 3.2.1 version I found that this new line added in the j 3.2.2 version :

if ((!$user->authorise('core.edit.state', 'com_content')) && (!$user->authorise('core.edit', 'com_content'))) {

如果我删除这一行,那么一切都会恢复正常.

If I delete this line then everything back to normal.

我的问题是,它是否被认为是 joomla 3.2.2 的错误?如果不是,我如何修改模块代码以允许我只显示最近 30 个月的文章而不修改articles.php?

My questions is, is it something considered a joomla 3.2.2 bug or not? If it's not, how can I modify the module code to allow me displaying only articles from the latest 30 months without modifying the articles.php?

谢谢

推荐答案

我已经针对这个问题提交了补丁.

I've submitted a patch for this issue.

查看问题跟踪项目.

这是 PR 和补丁:

对于 Joomla 3.2

For Joomla 3.2

https://github.com/joomla/joomla-cms/pull/3084

https://github.com/joomla/joomla-cms/pull/3084.diff

https://github.com/joomla/joomla-cms/pull/3084.补丁

对于 Joomla 2.5.x

For Joomla 2.5.x

https://github.com/joomla/joomla-cms/pull/3085

https://github.com/joomla/joomla-cms/pull/3085.diff

https://github.com/joomla/joomla-cms/pull/3085.补丁

这篇关于Joomla 3.2.2 问题:注意:未定义变量:nowDate/components/com_content/models/articles.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆