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

查看:111
本文介绍了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个月内的文章而无需修改article.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.patch

对于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.patch

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

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