User tests: Successful: Unsuccessful:
Pull Request for Issue #18178
Listing articles in sub-categories when categories filter is active is no longer working
This quite a big annoyance for people that need it,
Bug was introduced when category filter in articles manager was converted to multi-value
This PR fixes
In a Joomla installation that e.g. has testing articles
filter by category "Joomla" and you will notice that only 11 articles are shown , those that belong to category "Joomla"
also please test with
Those that belong to subcategories should also be listed (when max level filter is not set)
Those that belong to subcategories are not listed (despite max level filter not set)
None
Category | ⇒ | Administration com_content |
Status | New | ⇒ | Pending |
Even if this is perhaps just a side effect of the multi-select funtion, so I find that now better so. I have previously missed seeing only the articles of a category without subcategories. If you want to see the articles of the subcategories too, then better by selecting it additional.
The fix is very correct in terms that it restores the old and expected behaviour
(look at the code please)
it is very bad UX to select a category and not be able list articles in sub-categories
In my own extension i have implemented also listing records in sub-categories even when selecting multiple categories (combining the max-level filter)
To restore the old behavior, this patch is correct.
But I think it would be more logical to control the sub-categories with Max-Level when I want to see them. The selection of the category should only display those that were selected.
So I think the bug is that Max-Level does not change the display of the subcategories.
What you describe about multiple categories,
is trade-off that was accepted when category filter was made multi-value
Doing what you ask is possible
by creating multiple lft and rgt limiting clauses that are glued with OR
but e.g. @alikon believes otherwise
only the specific categories should be listed and
e.g. the max-levels filter should be hidden or a message should be shown to the user once per login session that articles are listed only in the specific (multiple-selected) categories
also the max-levels filter in single category starts at the level of the category
in the case of multiple categories it should propably start at the top, meaning it may be a little confusing to the user
let's fix this nasty UX bug for single category
and not add something that in my opinion would be a new feature
This is bug fix of previous / expected behaviour,
please forget me mentioning my extension
I mentioned it only to show that i have a little experience on the topic
Also i do not care so much for this PR,
we can just leave it broken and live with it
you can ask me to close it and i will do
We have a UX team - why not let them make the decision?
Sure,
my most important notes and questions are in this answer:
#18179 (comment)
how to behave with single category selected ?
how to behave with multiple category selected ?
show a warning message once per session that articles in sub-categories are not shown ?
Not really in favour of that.
Suggestion if possible: a new filter to display sub-categories articles or not for all cases (single and multiple categories selected.
Imho items from subcategories have to be shown when there is no level filter set. That is the old behavior and thus the expected one. Doesn't matter if one category is selected or multiple. The behavior has to be the same.
If you only want items from the selected categories, you set the level filter to 1. That's the point of that filter.
In my opinion, with the multi-selective of the categories, the level filter field has become obsolete.
I can now choose my subcategories more flexibly than before.
What makes sense now would be a selection field for "show all subcategories".
For me personally this bug is welcome. Finally, ONLY the items appearing in the selected category are displayed.
This has always annoyed me before, still have to adjust the level for this.
I have tested this item
We discovered this bug too. Today a client and myself was wondering about the new "feature" or the bug. My client called me and asked me, where to find his articles, listed in sub categories of a higher category. I said him, he should use the filter field "max level filter". He did. But couldn't find the expected articles. Why? I tested it, and must agree to him: this filter has broken! I agree with Bakuals posting.
Irrespective of the multi category filter mode, the "max level filter" should work like before. This is very important!
Labels |
Added:
?
|
Ok fixed previous behaviour for multiple categories too
now we will have J3.7.x behaviour in case of filtering by multiple categories
Fixed the max level filter is usage too,
by making it to be based on the deepest category
Title |
|
My test:
I have 2 root categories, each of them having a sub category.
If I filter by these 2 root categories and do not define a level for Select Max Levels
articles belonging to the root and children categories DO display fine
If I set Select Max Levels
to 1
I then loose the subcategory articles from the second category in the order they show in the filter. Here the sub category of Categoria (it-it) (it-IT).
But the articles form the first root categorie(fr-FR) subcategory DO display.
Note: I can't change the order of the root categories in the filter. I guess the order depends on their id.
Select Max Levels
to 2
to get back the display of the articles belonging to the subcategory of Categoria (it-it) (it-IT)
thanks for review, testing
i made a fix for depth level filter, and CS
please recheck / retest
I have tested this item
Looks fine now!
Please add a blank line before the foreach and one after the end of the foreach
Testing c140d1a not succesfull!
With one level || no level filter => okay.
With multi categories and level filter [e.g:2] => wrong listing.
category-filter: 1 category[root] && level-filter: 2 => 11 hits [okay].
category-filter: 1 category[sub-sub] && level-filter: 2 => 23 hits [okay].
category-filter: 1 category[root] && category-filter: 1 category[sub-sub] && level-filter: 2 => 93 hits [wrong listing].
In last example - so far I could find in short time - ALL sub-subs [3. level from root] are listed not only the selected sub-sub!
@hrefferh please mark your Test:
I have tested this item
#18179 (comment)
I think you have missed reading a part of the description
(when selecting multiple categories) the depth used is the depth of the depeest category
what you got was the expected / intended behaviour according to the above description
(the trade-off is that the max-level filter is now based on the deepest filtered category)
I have tested this item
(the trade-off is that the max-level filter is now based on the deepest filtered category)
the alternative is to create 1 join to the categories DB table per category selected in the category filter
-- this way we will be able to distiguish the level per category selected
if you would want this, i could do
Another option to make this consistent is always use depth from top
yes i agree it can be confusing,
re-thinking of it , i think , maybe it is possible to do without extra joins
checking it
done , now the (max) level filter is applied to every category individually
please retest
Also i found a bug in categories manager linking to article manager with wrong level filter, i will make a different PR
I have tested this item
Bingo!
root + sub1sub1 [ level: 2 ] => 11 hits
sub1sub1 [ level: 2 ] => 23 hits
root + sub1sub1 [ level: 2 ] && sub1sub1 [ level: 2 ] => 34 hits - identical to single filtering
GREAT! THANK YOU AGAIN FOR YOUR EFFORTS!!!
@infograf768 can you please retest?
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-10-09 23:26:48 |
Closed_By | ⇒ | mbabker |
I thought this fix was included in Joomla 3.8.2 but the feature still doesn't seem to be fixed
@bobr666 can you please open a new issue with that thing that don't work for you (please explain with as mach as possible detail) so we can keep track on open issues. Thanks!
https://github.com/joomla/joomla-cms/issues/new
I only noticed this on a site we just updated to 3.8.6 and seem the problem still persists?
I have a category blog link set to include subcategories - set to all, but only the articles from the parent category show.
This was a fix for the DB model of the backend articles manager,
it is not related to filtering of the frontend views
Sorry, I misread this, I'll test further & start a new issue, as think this is a bug.
i don't think this fix is correct
cause now we can select based upon multiple categories selection
so
if i choose to select multiple categories only, for me means i don't want articles from subcategories
but only articles from the selected categories