Joomla 3.2.2 issue: Notice: Undefined variable: nowDate /components/com_content/models/articles.php

StackOverflow https://stackoverflow.com/questions/21641365

  •  08-10-2022
  •  | 
  •  

Question

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);

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

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.

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?

Thank you

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top