Skip to content
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

[UX] Remove ordering/weight from the vocabularies listing page & style consistently with other admin pages #2029

Closed
jenlampton opened this issue Jul 26, 2016 · 34 comments · Fixed by backdrop/backdrop#3703

Comments

@jenlampton
Copy link
Member

jenlampton commented Jul 26, 2016

Is this left over from Drupal 6 when they all used to be thrown into the same form element? Does this order / value do anything on Backdrop sites? If not, can we please kill the tabledrag on this page? It's confusing to users.
screen shot 2016-07-26 at 11 25 17 am


PR by @arjunK2004: backdrop/backdrop#2736
PR by @klonos: backdrop/backdrop#2749
PR by @klnoos (created by jenlampton) backdrop/backdrop#3127
PR by @docwilmot (based on above PR) backdrop/backdrop#3703

@jenlampton jenlampton changed the title [UX] Why are taxonomies orderable? [UX] Why are taxonomy vocabularies orderable? Jul 26, 2016
@Hipfox
Copy link

Hipfox commented Jul 30, 2016

One of the reason, display taxonomy terms we need taxonomy menu tree order by weight. But in this vocabularies orderable ui when there are a lot of terms, the reordering fails.

Remaining tasks might include a more integrated solution or kill the tabledrag on this page.

@jenlampton
Copy link
Member Author

I'm not talking about terms, but the vocabularies themselves.

@Hipfox
Copy link

Hipfox commented Jul 30, 2016

Yes, I have no reason to keep it.

@klonos
Copy link
Member

klonos commented Jul 30, 2016

I don't see any reason either. Drop tabledrag and order alphabetically.

@ak2243
Copy link

ak2243 commented Jun 15, 2019

I created a pr, but I wasn't sure what to replace 'draggable' with so I replaced it with an empty string for now, what should I do now?
backdrop/backdrop#2736

@klonos
Copy link
Member

klonos commented Jun 15, 2019

@arjunK2004 we should also remove the weight field from the theme_taxonomy_overview_vocabularies() function, and generally make sure that the "show row weights" link is not rendered at the top-right of the table.

@klonos
Copy link
Member

klonos commented Jun 15, 2019

...actually, I don't see why this page should be a form any more if we remove the ordering/weight.

@klonos
Copy link
Member

klonos commented Jun 15, 2019

Does this order / value do anything on Backdrop sites?

FTR, this is also being deprecated in D8: https://www.drupal.org/project/drupal/issues/3008064

@jenlampton
Copy link
Member Author

jenlampton commented Jun 16, 2019 via email

@klonos
Copy link
Member

klonos commented Jun 16, 2019

Yep, @arjunK2004 do you still feel like giving it a crack?

@klonos
Copy link
Member

klonos commented Jun 16, 2019

@jenlampton can you please have a look at the comment in https://www.drupal.org/project/drupal/issues/3008064#comment-12824205 and also the use case in https://www.drupal.org/project/drupal/issues/7684 and let me know what you think re these? Are they too "specific"? My concern is that if we completely remove vocabulary weight, we may be breaking people's sites that rely on this functionality; and if the weight of vocabularies is indeed used, we'd be removing the option for people to be able to adjust that via the admin UI.

Having said the above, I have searched for taxonomy_node_get_terms(), and we don't seem to have such a function.

@klonos klonos changed the title [UX] Why are taxonomy vocabularies orderable? [UX] Remove ordering/weight from the vocabularies listing page Jun 16, 2019
@klonos
Copy link
Member

klonos commented Jun 16, 2019

...taxonomy_* functions have been removed on D7:

https://drupal.stackexchange.com/questions/8722/how-do-i-get-a-list-of-all-taxonomy-terms-assigned-to-a-node

https://www.drupal.org/forum/support/post-installation/2010-09-13/taxonomy_node_get_terms-in-drupal-7

So I wonder how one would achieve this (and if it is possible):

...I wanted to force ordering of vocabularies when listing the taxonomies of a node using the taxonomy_link() function. Basically, what I was doing was this: I created a "Story Type" vocab which described the overall type of post ( News, Rant, Review, ... ) and a "Topic" vocab which described the topic of the post ( Programming, Math, Political, Family, ... ). Now, when you added a new story, you picked a Story Type and a Topic. When the story is displayed, it shows the taxonomy assignments as a list of links. The ordering of that list was by term weight, term name. That meant that if I wanted to control the left to right layout of that information, I'd have to set the weight on every term in each vocabulary. That seemed tedious, especially since the vocabularies themselves already had a weight associated with them. Hence, I dug around for about 15 minutes and wrote this patch.

It's been tested and seems to work quite well. I can now force which taxonomy vocabulary is listed when, and thereby always make the posts appear as "Story Type | Topic".

@jenlampton
Copy link
Member Author

jenlampton commented Jun 17, 2019

@klonos my instinct is that removing these things is still fine for Backdrop, but you do make me hesitate about whether we should do it in 1.x or first deprecate it, but wait till 2.x to do the actual removal.

We've used it to allow customers to change the order of their filter

Theres no information here about what the "filters" are, but from the screenshot, I'd guess they are on a view? Those filters are usually ordered by their position in the views UI, and in order to do do something different we are already in the land of custom-coding, so this is not something that should be supported in core anyway.

Order taxonomy terms by vocabulary weight, then term weight

Hm, this brings up another thought... Do we have a "weight" in the vocabulary json file? If so, should we remove that too? This now becomes an API change. Maybe a follow-up issue? However...

The use-case here would not work in Backdrop anyway because the vocabulary weight is no longer in the database. Someone would need to add special handling to get the vocabulary data from config (its not a db join anymore).

@jenlampton jenlampton modified the milestone: 2.x-future Jun 17, 2019
@jenlampton jenlampton changed the title [UX] Remove ordering/weight from the vocabularies listing page [UX] Remove ordering/weight from the vocabularies listing page & deprecate use of weight value in config file (if possible) Jun 17, 2019
@klonos
Copy link
Member

klonos commented Jun 18, 2019

you do make me hesitate about whether we should do it in 1.x or first deprecate it, but wait till 2.x to do the actual removal.

I was thinking that we can deal with the UI bit in this issue here, and do it in 1.x. Then file a follow-up for deprecation/removal of API-related things.

@stpaultim
Copy link
Member

Wan't clear if this needed testing. But, I took a look in the sandbox and played around for a bit. Works for me!

@klonos
Copy link
Member

klonos commented Aug 26, 2021

Depending on which change gets merged first, either the PR for this issue or for #3402 will need to be updated accordingly.

@klonos
Copy link
Member

klonos commented Aug 26, 2021

Thanks for working on this @docwilmot 🙏🏼 ...a couple of minor comments left in the PR, but otherwise looks good 👍🏼

@jenlampton
Copy link
Member Author

jenlampton commented Aug 26, 2021

The PR looks good to me too, I've left a few comments in the PR as well for a (micro)performance optimization.

@docwilmot
Copy link
Contributor

Fixed

@jenlampton
Copy link
Member Author

This is RTBC from me now, but I expect it will conflict with #3402. Whichever gets in first, the other may need to be updated.

@laryn
Copy link
Contributor

laryn commented Aug 30, 2021

Thanks for filing this @jenlampton, and for the various PRs over the years @docwilmot, @arjunk04, and @klonos. Feedback and testing by all of you and @Hipfox, @BWPanda, and @stpaultim appreciated. Good job closing out an issue from 5+ years ago! 🎉

I've merged backdrop/backdrop#3703 into 1.x and 1.19.x.

@klonos klonos removed their assignment Aug 30, 2021
@jenlampton jenlampton changed the title [UX] Remove ordering/weight from the vocabularies listing page & style the page consistently with the Views listing page [UX] Remove ordering/weight from the vocabularies listing page & style consistently with other admin pages Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment