? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
4 Nov 2019

Pull Request for Issue #26970 (comment), first sentence, and #26970 (comment) .

Summary of Changes

Correct check for "never" filter for last visit date which was broken by PR #26611 (blush).

Don't use "orWhere" for text search filters because this will result in further, later "where" clauses being appended with "OR", which are those of the date range filters, if used. Thanks @SharkyKZ for this fix.

Beside this, for other date range filter options where 2 dates are used, the 2 comparisons ">=" and "<=" are replaced by using "BETWEEN", which is standard SQL and gives the same result. This change can be tested by code review.

Testing Instructions

Precondition: Have at least 2 users of which some visited the site and some others never visited the site.

  1. Go to "Users -> Manage".

  2. Click filter options.

  3. Select "never" in the dropdown "- Select last visit date -". Check the result in the list.

  4. Select any other date range for the last visit date. Check the result in the list.

  5. Enter in the text search box the username of a user for which the date range filter selected in step 4 matches. Then click the "search" icon right of the search box. Check the result in the list.

  6. Now either change the text in the search box or change the last visit date range so that there are users which match to one of these criteria but not to both.

Expected result

For step 3: Only users who never visited the site ("never" shown for last visit date in the list) are shown in the list.

For step 4: Only users with last visit date matching the selected range are shown in the list.

For step 5: Only those users are shown for which both criteria are true, the text search and the last visit date range.

For step 6: No user is shown.

Hint for testers: Please note that all these filters "today", "in the last week", "in the last month" and so on will always show a user who has registered or visited (depending on which filter) the site today, because today is in all these ranges (from 1 week ago until and including today, or from 1 month ago until and including today, and so on). This is desired behavior of these filters and was like this all the time. Only the filter "more than a year ago" excludes today, and for last visit date the "never" filter of course also does not include "today".

Actual result

For step 3: All users are shown in the list.

For step 4: Same as expected result for step 4.

For step 5: Users are shown for which either the text box or the last visit date matches the criteria.

For step 6: Users are shown for which either the text box or the last visit date matches the criteria.

Documentation Changes Required

None.

b85347a 4 Nov 2019 avatar SharkyKZ CS
avatar richard67 richard67 - open - 4 Nov 2019
avatar richard67 richard67 - change - 4 Nov 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Nov 2019
Category Administration com_users
avatar richard67 richard67 - change - 4 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 4 Nov 2019
avatar richard67 richard67 - change - 4 Nov 2019
Labels Added: ?
avatar richard67 richard67 - change - 4 Nov 2019
Title
[4.0] Fix filtering for never visited in users model
[4.0] Fix filtering in users model
avatar richard67 richard67 - edited - 4 Nov 2019
avatar richard67 richard67 - change - 4 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 4 Nov 2019
avatar richard67 richard67 - change - 4 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 4 Nov 2019
avatar richard67
richard67 - comment - 4 Nov 2019

@infograf768 Could you test this PR, and also test of there are no other issues anymore?

Regarding other "issues" discussed in PR 26970: Please note that all these filters "today", "in the last week", "in the last month" and so on will always show a user who has registered or visited (depending on which filter) the site today, because today is in all these ranges (from 1 week ago until and including today, or from 1 month ago until and including today, and so on). This is desired behavior of these filters and was like this all the time.

Only the filter "more than a year ago" excludes today, and for last visit date the "never" filter of course also does not include "today".

For me with this PR here all works like it should.

avatar richard67 richard67 - change - 4 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 4 Nov 2019
avatar richard67 richard67 - change - 4 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 4 Nov 2019
avatar richard67 richard67 - change - 4 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 4 Nov 2019
avatar infograf768
infograf768 - comment - 5 Nov 2019

Looks Ok now.
FYI phpMyAdmin refuses to update /administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-10-17.sql
I had to reinstall

avatar infograf768 infograf768 - test_item - 5 Nov 2019 - Tested successfully
avatar infograf768
infograf768 - comment - 5 Nov 2019

I have tested this item successfully on 3a49f03


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26982.

avatar richard67
richard67 - comment - 5 Nov 2019

@infograf768 For the problem with some update sql scripts and PhpMyAdmin with MySQL server versions 5.7 or later there is a trick: Copy the first statement for setting the sql_mode from joomla.sql into the SQL statements window before the statements from the update sql, so it runs first. This will set the session sql mode to something which does not include session variables for strict mode. Then the SQL should run with success in PhpMyAdmin.

avatar infograf768
infograf768 - comment - 5 Nov 2019

You mean

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

?

avatar richard67
richard67 - comment - 5 Nov 2019

Yes. First one is the important one. Second one not necessary but useful.

avatar richard67
richard67 - comment - 5 Nov 2019

@SharkyKZ One more tester needed.

avatar SharkyKZ SharkyKZ - test_item - 6 Nov 2019 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 6 Nov 2019

I have tested this item successfully on 6ed7099


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26982.

avatar SharkyKZ
SharkyKZ - comment - 6 Nov 2019

I have tested this item successfully on 6ed7099


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26982.

avatar SharkyKZ SharkyKZ - change - 6 Nov 2019
Status Pending Ready to Commit
avatar SharkyKZ
SharkyKZ - comment - 6 Nov 2019

RTC.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26982.

avatar infograf768 infograf768 - close - 6 Nov 2019
avatar infograf768 infograf768 - merge - 6 Nov 2019
avatar infograf768 infograf768 - change - 6 Nov 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-11-06 07:34:43
Closed_By infograf768
Labels Added: ?
avatar infograf768
infograf768 - comment - 6 Nov 2019

tks

avatar richard67
richard67 - comment - 6 Nov 2019

Thanks to all.

Add a Comment

Login with GitHub to post a comment