Skip to content

Conversation

@alikon
Copy link
Contributor

@alikon alikon commented Oct 19, 2025

Pull Request for Issue #46241 .

Summary of Changes

This change adds support for a tag_mode filter to the Articles list in com_content so callers can choose whether tag filtering should use OR (any) or AND (all) semantics. It also exposes the new filter via the API controller.

What this does

  1. Adds a new model state key filter.tag_mode (default: "any") to ArticlesModel.
  2. Implements "all" tag mode: when tag_mode=all and multiple tag IDs are provided, an article must have all of the specified tags to be included (AND semantics).
  3. Preserves the existing behavior as the default: tag_mode=any (OR semantics).
  4. Exposes the tag_mode parameter in the API controller (ArticlesController::displayList) and cleans input with the request filter.

Testing Instructions

GET api/index.php/v1/content/articles?filter[tag][]=2&filter[tag][]=3&filter[tag_mode]=all

Manual tests performed for:

  • Single tag with default behavior (any)
  • Multiple tags with tag_mode=any (OR)
  • Multiple tags with tag_mode=all (AND)
  • Missing/invalid tag_mode falling back to default

Actual result BEFORE applying this Pull Request

only logic OR

Expected result AFTER applying this Pull Request

Adds logic AND

Link to documentations

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

@alikon alikon marked this pull request as ready for review October 19, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants