User tests: Successful: Unsuccessful:
This PR is a for code/concept review
The aim of this PR is to add a new filter option when filtering for tags that allows you to filter all articles that have no tags at all.
It works but I am uncertain if its the correct approach - hence the draft pr for feedback.
Yes I know its a new feature so 5.4 may not be the correct branch - that can be changed later when I know if thats 5.4 or 6
This is only for com_content (articles and featured articles) if accepted then this can be extended to all components that have a filter by tag - that can be done later when I know this is accepted
Yes I know the language string is missing - that will come with #45232
Yes I know there are some unrelated files - this will be resolved with the next upmerge from 5.3 if I understand it correctly
To test create four articles
Article 1 no tags
Article 2 taga
Article 3 tagb
Article 4 taga and tagb
Using the filter check that the filter works correctly when selecting any of the tags AND/OR items with no tags (None)
You should be able to filter the articles on any single tag or combination of tags AND filter the articles with no tags and any single tag or combination of tags
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content |
Labels |
Added:
PR-5.3-dev
|
Category | Administration com_content | ⇒ | Administration com_content External Library Composer Change Libraries |
Title |
|
This PR is a for code/concept review
The aim of this PR is to add a new filter option when filtering for tags that allows you to filter all articles that have no tags at all.
Love the ability to filter all articles that have NO tags - so Thank you! @brianteeman!
I have tested this item ✅ successfully on e9ce9c0
I have tested this successfully. (Thank you @brianteeman).
I have tested this item ✅ successfully on e9ce9c0
Labels |
Added:
Composer Dependency Changed
PR-5.4-dev
Removed: PR-5.3-dev |
Category | Administration com_content External Library Composer Change Libraries | ⇒ | Administration com_content External Library Composer Change |
Category | Administration com_content External Library Composer Change | ⇒ | Administration com_content |
Build | 5.3-dev | ⇒ | 5.4-dev |
@brianteeman The tag filter allows to select more than one tag.
From reading the code and from a real test, I see that your code handles only the case that only the "None" option is selected.
But as soon as you select it in combination with another tag, the query finds only those with that tag.
For proper handling of a combination of the "None" option together with another tag, it would need to have some code in the if ($tag && \is_array($tag)) {
case, similar to what @AdarshSantoria has done in his PR #45264
I was thinking that this morning. Will try to work out the query
Labels |
Removed:
Composer Dependency Changed
|
@richard67 I cant get my head around that change - any help appreciated
@richard67 I cant get my head around that change - any help appreciated
@brianteeman For "none" as the only option it might help not to use type safe comparison.
For the combination with other tags it needs something like this to be added to the case if it is an array below the } elseif ($tag && \is_array($tag)) {
: https://github.com/joomla/joomla-cms/pull/45264/files#diff-add0f2892993b0d9480d645a92e769680f686d32a708025cbb466cd08c99b98aR427-R445
That means if the array contains a zero value, use the query with subquery, and if not, just use the old query.
I understood what query you meant I just cant get my head around creating it
I understood what query you meant I just cant get my head around creating it
It might take some time until I can help with that, but I keep it in mind.
If this goes into 5.4, also featured filter and featured model must be included.
Thanks for not reading
@brianteeman Not related to the previous 2 comments: I need a bit more time for finding the right query. It’s still on my task list and will not be forgotten. I plan to work on it on next weekend. Just wanted to let you know.
@richard67 I know I can rely on you
@brianteeman I have something ready which I just have tested with success, but I have to go to a family meeting now. I will later submit a PR in your fork.
@brianteeman I've found a way, see brianteeman#602 . It might look a bit complicated, but it covers all possible combinations of tag filter selections.
i've merged your change and will test fully tomorrow before removing draft status - thanks
This is now ready for testing thanks to the assistance of @richard67
@brianteeman Maybe the testing instructions should be extended for the case that some articles have more than one tag assigned?
@brianteeman Maybe the testing instructions should be extended for the case that some articles have more than one tag assigned?
I thought I already did
Using the filter check that the filter works correctly when selecting any of the tags AND/OR items with no tags (None)
Added an extra sentence to the test instructions for increased clarity
@brianteeman Maybe the testing instructions should be extended for the case that some articles have more than one tag assigned?
I thought I already did
Using the filter check that the filter works correctly when selecting any of the tags AND/OR items with no tags (None)
@brianteeman That's for the different combinations in the filter. What I mean is:
To test create three articles
Article 1 no tags
Article 2 taga
Article 3 tagb
Change to e.g.:
To test create four articles
Article 1 no tags
Article 2 taga
Article 3 tagb
Article 4 taga and tagb
or something like that.
I have tested this item ✅ successfully on 0676089
I have successfully tested this!
It works with taga, tagb, taga+tagb, taga+None, tagb+None, Millions+Love+tagb, Millions+Love+Joomla+taga+tagb+None and many other combinations :) :D
I have tested this item ✅ successfully on 0676089
Successfully tested with MySQL 8.0.41 and PostgreSQL 16.8.
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
RTC
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-05-10 15:56:02 |
Closed_By | ⇒ | muhme |
Thx all
@brianteeman The unrelated changes will disappear when we have done the next upmerge from 5.3-dev to 5.4-dev and then updated this PR to 5.4-dev. So all ok.