User tests: Successful: Unsuccessful:
Pull Request for Issue # .
The database query with relative date fails because the $nowDate is not 'quoted'.
Create new module instance of mod_articles_category and set filter to relative date.
The Query fails and the frontend shows an error:
Warning: Invalid argument supplied for foreach() in /Users/marcorensch/Sites/joomla4b5/components/com_content/src/Model/ArticlesModel.php on line 713
Warning: Invalid argument supplied for foreach() in /Users/marcorensch/Sites/joomla4b5/modules/mod_articles_category/src/Helper/ArticlesCategoryHelper.php on line 257
The query runs and the searched articles gets loaded.
The $nowDate was already quoted in Joomla 3.x, but was not initially set in J4 because in line 298/299 /378/379/538/539 $nowDate is used with bind which does not have to be 'quoted'. The easiest & cleanest way is to 'quote' $nowDate directly in the relative query.
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_content |
Labels |
Added:
?
|
@HLeithner The prepared statements did not work with these relative date statements, that's why @SharkyKZ has suggested to revert that, and I think he is right.
Already thought this... should be commented...
Set Date Filtering to Relative Date. Before Patch: Confirm Actual Result (Warnings)
Enabled Patch: Warning has gone off, but the module mod_articles_category is not visible in frontend.
Joomla 4.0.0-beta7-dev
I have tested this item
Tested successfully.
@ChristineWk - maybe none of your articles met the filter?
@chmst
I'm not sure :-) but have enough articles:
I have tested this item
Solution: I had wrong filter date.
I have tested this item
Tested with MySQL and PostgreSQL.
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-01-18 14:32:49 |
Closed_By | ⇒ | infograf768 | |
Labels |
Added:
?
|
Tks.
@HLeithner The prepared statements did not work with these relative date statements, that's why @SharkyKZ has suggested to revert that, and I think he is right.