Opened 16 years ago
Closed 15 years ago
#7000 closed enhancement (duplicate)
On Write Post screen, Checked Categories should be on top of the list
Reported by: | mdawaffe | Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | normal | Version: | 2.5.1 |
Component: | Administration | Keywords: | needs-patch |
Focuses: | Cc: |
Description
In WP 2.3, a post's current categories were listed at the top of the categories list for easy identification.
Since the move to the Walker class, that is no longer true.
Attached
- Uses the Walker twice to put checked categories first.
- Does not change the DB queries. It post-processes the old ones. We could only query for categories that are/aren't checked for that post, but the post-processing method means that the query is the same for all posts. Good for query/object caching.
- Passes
$popular_categories
towp_category_checklist()
to save a query, reduce inconsistencies. - Tweaks JS/AJAX.
2.5.2?
Attachments (4)
Change History (27)
#2
@
16 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This is an extremely annoying UI issue. Along with putting things out of order (and thus making them harder to find), it causes checked sub categories to look like main categories! I'd prefer to see it reverted (ASAP), but can we at least add in a hook that will let us adjust "$args" to empty $argsselected_cats??
Maybe something like: $args = apply_filter('wp_category_checklist', $args);
somewhere around line 214?
Again, I'd rather see it reverted, but I'm attaching a patch anyway.
#3
@
16 years ago
- Keywords needs-patch added; has-patch needs-testing removed
Ok, I chatted with Matt in IRC for a bit, and he's not a fan of the falter as a solution to this problem (although he said the filter could be useful, it needs to be in ADDITION to a fix for this). The main problem seems to be that if you select a sub category, you lose the context of the hierarchy (checked categories have no hierarchy). There are a couple cases where this can get REALLY confusing. Say (among others)you have a these categories:
Dogs->Shows Cats->Shows
And you check Dogs->Shows. When you edit that post, you no longer get the context, and "Shows" is ambiguous. The same can happen if you have:
WordPress Plugins->WordPress
matt said:
it seems like rather than not having the checked ones at the top, a better solution might be showing some of the hierarchy inline with checked-at-top categories
#5
@
16 years ago
Yeah, this drives me nuts too (the children showing up as parents), but I can somewhat understand why it was done.
Still doesn't mean I'm in favor if it though. ;)
#6
@
16 years ago
What i'd like to see is:
C Prefixes: PHP C WordPress Plugin U Blah U Prefixes U Opinion U Other Prefix
C = Checked, U = Unchecked, If its not visible, 'PHP' is a subcat of the 'Prefixes' category..
#7
@
16 years ago
As an alternative, you could do something like:
U Prefixes C PHP C WordPress Plugin U Blah U Prefixes U Opinion U Other Prefix
The advantage is that it keeps some consistency as far as children are indented and under their parent. The disadvantage is that it leaves you with "Prefixes" on the list twice.
I'm still wondering what milestone this should be. To me, it was a bug introduced in 2.6 (I'd love to see it make it into the 2.6 branch, 2.7 isn't due out for 3 months). Unfortunately, 2.7 may be more realistic.
#10
@
16 years ago
See also #6920 duplication of category names which is still an issue in the 2.7 beta1.
#12
@
16 years ago
- Milestone changed from 2.9 to 2.8
- Priority changed from normal to high
Because my new report has been closed as duplicate http://trac.wordpress.org/ticket/8521 and pointed to this one, i will try to explain my issue here again.
The category box displays 2 kinds of views:
- tree view of all categories
- linear view of mostly used
In my opinion, if a tree view will be used to show parent/child relationships, this tree have to be always consistent. That's why it is counterproductive to rupture this by isolating assigned post categories and leave unassigned linear at the end of tree.
A practical example would be tree based categories, where the main nodes stand for languages like english, german, italian etc. and the childs are the real language dependend categories. Handling this by current behavoir, this extracts some language dependend childs and put them out of order at the end of tree. This also prevents injected admin javascripts to hide some main trees node (and their child implicitely) not nessessary for current posts language, because the extracted loose childs at the end remains while not longer linked to parent.
My suggestion would be to extend the box with 3 possible visual kinds:
- tree view of all (keeps always correct order)
- linear list of all (sorts assigned cats at start)
- linear list of mostly used (sorts assigned cats at start)
The box has to remember, what user prefere so you will provide for all user needs the way of correct displayment.
#15
@
16 years ago
Just figured I would try to revive this a little. One problem with doing something like:
U Prefixes C PHP C WordPress Plugin U Blah U Prefixes U Opinion U Other Prefix
Is you have to take into account that if a user clicks the top 'Prefixes' box that the bottom one needs checked also.
I'm thinking something like the following would be better:
U Prefixes C PHP U Opinion U Other Prefix C WordPress Plugin U Blah
#16
@
16 years ago
- Cc matt@… added
- Keywords has-patch dev-feedback added; needs-patch removed
Just put together a quick patch that will lay out the items as DD32 had mentioned:
C Prefixes: PHP C WordPress Plugin U Blah U Prefixes U Opinion U Other Prefix
There may be a quicker/easier way to do what is in this patch, but like I said it was a quick attempt.
#17
follow-up:
↓ 18
@
16 years ago
How deep can the category structure go? Do we need to take into account:
Great Grandparent: Grandparent: Parent: Category
#18
in reply to:
↑ 17
@
16 years ago
Replying to aaroncampbell:
How deep can the category structure go? Do we need to take into account:
Great Grandparent: Grandparent: Parent: Category
Ah...good catch. My test was only done with Parent->child. I imagine this could get ugly.
The categories page only shows at most Grand Parent->Parent->Child
The list on the edit/write posts page on shows hierarchy for Parent->Child or Grand Parent->Parent
So currently the listing doesn't on the edit/write posts page, while it displays more than the categories page will only shows a 2 level hierarchy. I would say that unless we want to change the display on the categories page that maybe 3 levels is the most we should handle.
#19
@
15 years ago
I'm going to work on this one for the 24hour marathon. I'm thinking that creating a get_root_category() function to use would be a relatively simple solution.
#20
@
15 years ago
The new patch is based off the one one by sivel, and properly displays all the ancestors using get_category_parents()
. There is however, another problem. If you have a category structure like this:
Prefixes Other PHP test Something Uncategorized
Now, if you check test it works great like this:
C Prefixes:PHP:test U Prefixes U Other U PHP U Something U Uncategorized
However, if you check only PHP you get this:
C Prefixes:PHP U Prefixes U Other U Something U Uncategorized U test
Notice that the test category has been orphaned at the bottom. What do you think should be done in this case?
#21
@
15 years ago
- Keywords needs-patch added; has-patch dev-feedback removed
maybe the full list should be included with some options being selected twice? it won't hurt much if they are, if they're sync'd using js.
maybe this could also be done using js: on load, we move the ones that are checked to the top. on check they move to the top, on uncheck they revert to their original position.
(In [7956]) Put checked categories at the top of the checlist. Props mdawaffe. fixes #7000 for trunk