-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[5.4] Feature: Add year filter order parameter for archived articles #45841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.4] Feature: Add year filter order parameter for archived articles #45841
Conversation
4eea2f8
to
66be4fc
Compare
- Add filter_field_years parameter to ArchiveModel getYears() method - Support ASC/DESC ordering of years in archived articles list - Include input validation for security (only ASC/DESC allowed) - Add menu item configuration option in default.xml - Add language strings for year ordering parameter - Fix binary_operator_spaces alignment for coding standards
66be4fc
to
fde21f0
Compare
@Aashish-Jha-11 Hmm, you should remember from your previous PR that new features will not go into 5.3. |
I've rebased this PR for 5.4-dev for now. As said, 5.3 only receives bug fixes, no new features. |
@Aashish-Jha-11 I used Patchtester to apply your PR to a copy of an existing site. I realized that the new option has not been included on the "Options", but on the "Archive" tab. IMHO this is the better place to put it. But you should change your testing instructions (and later the documentation) from "Archive Options tab" to "Archive tab". Using Patchtester, I would not get the new language strings applied. Apart from that, my test was okay. I will follow up a test with the Drone package to get the correct language strings. |
I have tested this item 🔴 unsuccessfully on 9e8a206 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45841. |
you obviously have not tested your work as the language string MUST be added to the admin language file |
Menu configuration language strings should only be in administrator language file. Fixes language string loading issue per review feedback.
Adds COM_CONTENT_FIELD_YEAR_ORDER_LABEL and COM_CONTENT_FIELD_YEAR_ORDER_DESC to administrator language file for menu configuration.
@Aashish-Jha-11 your first contribution to Joomla! Welcome! |
Move the language strings into: |
Kept language strings only in administrator language file as per review feedback. Added COM_CONTENT_FILTER_AUTHORS_BY_ME from upstream changes.
Hi @chmst! Thank you for the warm welcome and guidance! 🙌 You're absolutely right - I've now moved the language strings to Thanks for the feedback! |
@Sieger66 Exactly right! ✅ The language strings are now properly placed in Thanks for confirming the correct location! |
@brianteeman Thank you for the feedback! Sir You're absolutely correct - the language strings are now properly added to the administrator language file at The implementation now follows proper Joomla standards. Thanks for the guidance! |
@dautrich Thank you so much Sir for the detailed testing! 🙏 You're spot on about the field placement - it's in the "Archive" tab which is indeed the better location for this functionality. I've updated the testing instructions accordingly. Regarding the language strings issue with Patchtester - this is a known limitation where Patchtester sometimes doesn't properly apply language file changes. The strings are correctly implemented in Thanks for the thorough testing and helpful feedback! |
No its not - you just put them in the wrong place |
Please rename this to SORT not filter Please move the field so that it is after the field "date for ordering" as its more logical to be placed there than after the filter field option |
- Rename language strings from YEAR_ORDER to YEAR_SORT - Move field after 'date for ordering' field for better logical placement - Update field name from filter_field_years to year_sort_order - Update model to use new parameter name and consistent variable naming Addresses @brianteeman feedback on field naming and positioning.
@brianteeman Thank you Sir for the specific feedback! ✅ I've implemented both of your requests:
The field now appears in this order:
Thanks for helping improve the UX! The implementation is now much more intuitive. |
The year sort parameter validation is unnecessary since Joomla's form validation with validate='options' already ensures only valid values (ASC/DESC) can be saved when the form is submitted.
I have tested this item ✅ successfully on b490e06 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45841. |
1 similar comment
I have tested this item ✅ successfully on b490e06 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45841. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45841. |
Off-topic: You don't need to say "Thank you" so often here. I think that we all are here to help each other, and to help make Joomla an even greater product. |
✅ Final test before merge
|
Thank you @Aashish-Jha-11 for your contribution. Thank you @brianteeman, @Sieger66, @chmst and @QuyTon for supporting this PR. Thank you @dautrich and @ChristineWk for testing. |
see #45853 |
@brianteeman The change request by @QuyTon was closed by @Aashish-Jha-11 before the merge, so @muhme could not see it and can't be blamed. Possibly a misunderstanding by @Aashish-Jha-11 . |
Hi all, Sorry for the confusion caused. |
Summary
Adds a "Year Filter Order" parameter to the archived articles menu item configuration, allowing users to sort years in ascending (oldest first) or descending (newest first) order.
Pull Request for Issue #45772
Resolves #45772
Summary of Changes
filter_field_years
parameter to/components/com_content/tmpl/archive/default.xml
ArchiveModel::getYears()
to use the parameter with security validationTesting Instructions
Types of changes
Checklist: