[CMS PR 46325] Revert unrelated cs change and move include none logic#156
Closed
richard67 wants to merge 1 commit intoalikon:webservices-logic-and-for-tagsfrom
Closed
[CMS PR 46325] Revert unrelated cs change and move include none logic#156richard67 wants to merge 1 commit intoalikon:webservices-logic-and-for-tagsfrom
richard67 wants to merge 1 commit intoalikon:webservices-logic-and-for-tagsfrom
Conversation
Reviewer's GuideRefactors the content articles model by reformatting filter field definitions and relocating the tag include-none (tag=0) logic so it only applies to OR-mode tag filtering, reverting a previous broader change. Class diagram for ArticlesModel tag filtering changesclassDiagram
class ArticlesModel {
+__construct(config, factory)
+getListQuery() QueryInterface
-configureFilterFields(config)
-applyTagFilter(query, db, tag, tagMode)
}
class QueryInterface {
}
ArticlesModel ..> QueryInterface : returns
Flow diagram for includeNone tag logic in getListQueryflowchart TD
A[Start tag filtering] --> B{tag is array and not empty?}
B -->|No| Z[Skip tag filter]
B -->|Yes| C[Read tag_mode state]
C --> D{tag_mode == 'all'?}
D -->|Yes AND| E[Build AND-mode subquery without includeNone handling]
E --> F[Apply AND-mode tag filter to main query]
F --> Z
D -->|No OR| G[Set includeNone to false]
G --> H{Tag array contains 0?}
H -->|Yes| I[Remove 0 from tag array using array_filter]
I --> J[Set includeNone to true]
H -->|No| K[Keep tag array as-is]
J --> L[Build OR-mode subquery on #__contentitem_tag_map]
K --> L
L --> M[Apply OR-mode tag filter to main query]
M --> N{includeNone is true?}
N -->|Yes| O[Extend query to include items without tags]
N -->|No| Z
O --> Z[End tag filtering]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The compressed
filter_fieldsarray format makes future diffs and maintenance harder to read; consider reverting to one entry per line to keep changes localized and easier to review. - In the tag OR-logic branch, after
array_filter($tag)you might want to guard against an empty$tagarray (e.g. early return or skip building the subquery) to avoid running an unnecessary query when only the0sentinel was provided.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The compressed `filter_fields` array format makes future diffs and maintenance harder to read; consider reverting to one entry per line to keep changes localized and easier to review.
- In the tag OR-logic branch, after `array_filter($tag)` you might want to guard against an empty `$tag` array (e.g. early return or skip building the subquery) to avoid running an unnecessary query when only the `0` sentinel was provided.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Author
|
Hmm, wait, I might have to fix that empty array thing. |
Author
|
Closing as the moving of the none logic is false, so only the code style thing is remaining for which there is already a suggested change in the CMS PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for joomla#46325 .
Summary of Changes
See my 2 still open review comments in the CMS PR.
Summary by Sourcery
Adjust article model filtering configuration and refine tag filter handling in the articles list query.
Bug Fixes:
Enhancements: