Reorder Categories behaving strangely

I’ve never tried to reorder Categories until yesterday and it was a nightmare!

I created a new Category yesterday and wanted to move it up the chain so that it would be near the top. When I clicked the up arrow, it went up twice, then wouldn’t move up anymore. I could move it down, but never up past that point. Then it wouldn’t move at all.

Today I thought it might be a theme issue (I don’t have any plugins) so I entered safe mode and same thing is happening, none of my attempts to reorder categories happen as expected.

I tried to move random categories around (most have subcategories btw) and some would move, some wouldn’t move at all… there’s no rhyme or reason to it that I can discern.

I’m on v2.2.0.beta5 +157.

Any thoughts?

EDIT: Forgot to include screenshot

Can you be more specific about what you’re encountering? Which categories won’t move? Are they parent or sub-categories? Is it the arrows that don’t work, or the number input?

1 Like

I’m only trying to move parent categories, not sub-categories.

To be honest it’s a bit all over the place. When the arrows wouldn’t work, I tried giving it a number (6, in this case) to bump it up where I wanted it to be, and it worked, but then when I tried to give it another number, it would no longer move to that number. So sometimes arrows don’t work, sometimes numbers. On my screenshot, trying to move #29 wouldn’t work at all with arrows. If I try to move #30 up or down, same thing, arrows don’t work. Trying to change #30 to #24 doesn’t work either.

I did some testing on sub-categories also, and although the arrows work well in this case (within their parent category), trying to change the number to swap sub-categories with one another doesn’t always work. I just tried entering the number 28 in the one labeled 26, and all it did was swap 26 and 27, and 28 remained the same. However, if I move 26 down to 28 with the down arrow, and then change the number 26 to 28 (to move it back), that works.

Like I said, it’s all over the place.

1 Like

Yeah, something’s not working quite right here. I can’t reproduce the arrow issue on try, but entering numbers doesn’t work consistently. For example, if I enter 2 for uncategorized it does nothing. Entering 3 works, but moves it to 2, not 3. There are no subcategories on try, I wonder if that’s why the arrows are working for me.

1 Like

It would be interesting to see if you could reproduce the arrows issue as well (by adding sub-categories). I can’t play around with mine too much at the moment as it’s a live site.

I’m having some similar issues, but somewhat more severe. None of my arrows do anything, and any number I enter gets reverted to its previous value as soon as I focus out.

However, after adding a new category, I am able to reorder it by entering a number but not the arrows. Categories above/below the new category can then be moved around it, but are still unable to be reordered relative to other pre-existing categories.

Hmm @joffreyjaffeux is this Ember upgrade related?

1 Like

I doubt it, it seems people in this topic are experiencing it on their own site. It’s still only deployed on meta.

4 Likes

I have the same issue.

Opened a PR :slight_smile:

https://github.com/discourse/discourse/pull/7190

2 Likes

As a workaround until this is fixed: clicking the “Apply” button at the bottom of the form frequently is your friend. Clicking it after a successful use of an arrow button will put the form into a state that makes it quite probable that another use of an arrow button will also be possible.

This is how I have kept a list of ~100 categories in order for 18 months now …

3 Likes

Is the order alpha numeric?

Not strictly alphanumeric order, no. It’s alphanumeric only for the two largest sets of subcategories, and even there with exceptions (placing the most important ones at the start of the list).

Category reordering with the arrows does not work when there are subcategories. Quick repro:

image

The movies category cannot move down, and the tech category cannot move up. It seems the subcategory is preventing this movement.

@venarius, I know you did some work on improvements here before, any interest in taking a stab at this?

1 Like

Will look into it :slight_smile: thanks for tagging!

5 Likes

Created a PR :partying_face: :

https://github.com/discourse/discourse/pull/7374

7 Likes