Feature RTC Unit/System Tests Composer Dependency Changed NPM Resource Changed Webservices PR-6.0-dev Pending

User tests: Successful: 0 Unsuccessful: 0

avatar laoneo
laoneo
15 Mar 2025

Summary of Changes

Adds two new filter options to the articles list endpoint. The new modified_start and modified_end filters do allow to fetch articles which are modified within a date range. This is a common use case in API's, as it allows consumers to fetch only the delta which has changed since the last sync and not always the full list of articles. The following example fetches only articles which are edited within February 2025:

GET /api/index.php/v1/content/articles?filter[modified_start]=2025-02-01&filter[modified_start]=2025-02-28

Testing Instructions

  • Create an article with the modified date before February 2025
  • Create an article with the modified date after February 2025

Use tools like postman to execute the following curl command against the joomla installation with the patch:

curl -g "https://{web site}/api/index.php/v1/content/articles?filter[modified_start]=2025-02-01&filter[modified_start]=2025-02-28" -H "Authorization: Bearer {your token}"

Actual result BEFORE applying this Pull Request

All articles are returned.

Expected result AFTER applying this Pull Request

Only the article which was modified after the first February is returned.

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

avatar laoneo laoneo - open - 15 Mar 2025
avatar laoneo laoneo - change - 15 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2025
Category Administration com_content JavaScript Unit Tests
avatar laoneo laoneo - change - 15 Mar 2025
The description was changed
avatar laoneo laoneo - edited - 15 Mar 2025
avatar laoneo laoneo - change - 15 Mar 2025
Labels Added: Unit/System Tests PR-5.3-dev
avatar laoneo laoneo - change - 16 Mar 2025
Title
[5.3] Add modified start and end date filter to articled API endpoint
[5.3] Fixes the missing modified start and end date filter to articled API endpoint
avatar laoneo laoneo - edited - 16 Mar 2025
avatar laoneo laoneo - change - 16 Mar 2025
Labels Added: Webservices
avatar alikon alikon - test_item - 16 Mar 2025 - Tested successfully
avatar alikon
alikon - comment - 16 Mar 2025

I have tested this item ✅ successfully on 2493253


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

avatar exlemor exlemor - test_item - 16 Mar 2025 - Tested successfully
avatar exlemor
exlemor - comment - 16 Mar 2025

I have tested this item ✅ successfully on 2493253

Thanks to @alikon's and @richard67's help, I was able to successfully test this via Postman!


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

avatar QuyTon QuyTon - change - 16 Mar 2025
Status Pending Ready to Commit
avatar QuyTon
QuyTon - comment - 16 Mar 2025

RTC


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

avatar muhme muhme - test_item - 16 Mar 2025 - Tested successfully
avatar muhme
muhme - comment - 16 Mar 2025

I have tested this item ✅ successfully on 2493253

Tested with local Joomla 5.3-dev on macOS

  • Before applying this PR:
    • Overall System Tests 538 passed
    • Tested API with HTTP Status 200 (unknown filters are ignored)
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles"
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-02-01&filter[modified_end]=2025-02-28"
  • After applying this PR with Patch Tester
    • Overall System Tests 539 passed (including the new one)
    • Created three articles january, february and march and changed modified date in database to 15th and time to 12:00:00
    • checked
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-02-01&filter[modified_end]=2025-02-28" # Get only february article
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-01-01&filter[modified_end]=2025-04-01" # Get all three articles
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-02-01" # February and March article
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_end]=2025-02-01" # Only January article
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-01-15%2012:00:00&filter[modified_end]=2025-03-15%2012:00:00" # All three articles
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-01-15%2012:00:00&filter[modified_end]=2025-03-15%2011:59:59" # January + February article
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-01-15%2012:00:00" # all three
      • curl -w "\nHTTP Status: %{http_code}\n" --header "X-Joomla-Token:${token}" "${baseUrl}/api/index.php/v1/content/articles?filter[modified_start]=2025-01-15%2012:00:01" # only februrary and march article
        This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45142.
avatar laoneo laoneo - change - 19 Mar 2025
Labels Added: RTC
avatar laoneo laoneo - change - 19 Mar 2025
The description was changed
avatar laoneo laoneo - edited - 19 Mar 2025
avatar rdeutz rdeutz - change - 21 Mar 2025
Title
[5.3] Fixes the missing modified start and end date filter to articled API endpoint
[6.0] Fixes the missing modified start and end date filter to articled API endpoint
avatar rdeutz rdeutz - edited - 21 Mar 2025
avatar Bodge-IT Bodge-IT - change - 24 Mar 2025
Labels Added: Feature PR-6.0-dev
Removed: PR-5.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 24 Mar 2025
Category Administration com_content JavaScript Unit Tests Administration com_content com_users JavaScript Repository NPM Change External Library Composer Change Front End Plugins Unit Tests
avatar softforge softforge - change - 24 Mar 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-03-24 23:09:33
Closed_By softforge
Labels Added: Composer Dependency Changed NPM Resource Changed
avatar softforge softforge - close - 24 Mar 2025
avatar softforge softforge - merge - 24 Mar 2025
avatar softforge
softforge - comment - 24 Mar 2025

Thank you @laoneo and the testers for all your work

Add a Comment

Login with GitHub to post a comment