[6.2] Include archived categories in edit and batch dropdowns#46706
Conversation
|
i wonder why we have never been able to do this before. As far as I can tell the behaviour has been this way for at least 8 years and probably longer This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46706. |
|
@brianteeman But it fixes the bug where an archived category would get swapped out for the first available non-archived category which is an improvement. Would be glad to hear some advice on how to progress with this further. |
|
@chmst In category edit view [jobs] means: unpublished instead of archived. Archived categories are not visible in this view. Archived categories are also not visible in batch process of categories. |
|
@peterhulst you also have to think about side effects. For batch process, the result is not acceptable. |
|
@chmst yes, i am working on it right now. |
|
@chmst non-published categories should now have brackets around them in the batch operations dropdown. |
|
Thank you @hiteshm0 for the change, but this is not what we do in Joomla. We separate data and presentation layer. Another solution would be: Let the code as it is now, filter = 0, 1. then append '- archived categories -' (use a language key) This seems less confusing than having prublished and archived categories mixed in a dropdown. |
|
I have checked e580fa5 and it works as expected. Proposal: The code change in the latest modification is easy: Change to: And in components\com_categories\src\Field\CategoryeditField.php: Change to: Regards, |
|
@peterhulst your proposal definitely works but as mentioned by @chmst it is not in joomlas practice to do database queries in layouts, so the solution will become quite complicated. |
|
@hiteshm0 The proposal of @peterhulst means that you can remove the database access. You need only the extra line for archived categories. Layout: At the moment, there is no difference for published and unpublished categories - but could be interesting. |
|
if we dont display any difference between published/unpublished categories then I wouldnt expect any visual difference with archived |
|
i dont understand why this is labelled a b/c break. Nothing breaks you just get extra functionality |
|
@brianteeman its most probably labelled as a b/c break, because in the batch operations dropdown there is no difference in the way archived and published categories are shown ( even unpublished categories are shown without any brackets ). |
|
That doesn't constitute a breaking change |
|
quite a bit of duplicate code in CategoryeditField.php |
|
a and u might make sense in english but who knows about all the other supported languages. The words might start with the same letter |
Indeed that is the case for more languages. Danish would be (A) arkiveret and (A) afpubliseret. |
|
I have tested this item ✅ successfully on 1dee2b8 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46706. |
1 similar comment
|
I have tested this item ✅ successfully on 1dee2b8 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46706. |
|
Please use a long language string for archived and unpublished in barracks, I think it could already exist. |
|
I have tested this item ✅ successfully on 163c0fa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46706. |
|
I have tested this item ✅ successfully on 163c0fa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46706. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46706. |
|
@HLeithner Could you check if your requested change (see #46706 (comment) ) has been implemented like you suggested, and if yes, either dismiss your change request or approve the code changes)? Thanks in advance. |
|
I only checked the changed language string and since JARCHIVED has been used, it's the long version, so it should be fine. I think that can go into 6.2 @MacJoom @charvimehradu |
|
should i rebase this to 6.2 ? |
|
This pull request has been automatically rebased to 6.2-dev. |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
@hiteshm0 I've allowed myself to fix the conflicts in file |
|
Thank you! |



Pull Request for Issue #46701
Summary of Changes
This PR fixes issue #46701 where archived categories were not selectable in article edit and batch operation dropdowns. And prevents category from resetting to first available non-archived category when editing articles assigned to archived categories.
Testing Instructions
First Test:
Create an article.
Verify that archived categories can be assigned to the article.
Assign a archived category to the article.
Edit the article
Verify that the category of the article has not been auto assigned to the first available non-archived category.
Second Test:
Third Test:
Verify that categories can be assigned archived categories as their parents
NOTE: If a published/unpublished category is assigned an archived category as its parent, then those categories also become archived.
Actual result BEFORE applying this Pull Request
When editing an article assigned to an archived category, the category dropdown did not show the archived category.
If the category of an article was archived then, it would be changed to an available non-archived category upon editing the article.
Archived categories were not listed in the batch "Select Category for Move/Copy" dropdown
Cannot assign archived categories as parent to other categories.
Expected result AFTER applying this Pull Request
Category drop-down when editing an article shows archived categories. Archived categories assigned to articles don't get swapped for non-archived categories
Archived categories are listed in batch "Select Category for Move/Copy" dropdown.
Archived categories can be assigned as parent to other categories
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