Category selectors shouldn't be updated when selecting and failing to set a parent category

In my example, I’m trying to set a parent category on a category that already has a child category. Naturally, I hit an error message. Despite this, the category selectors are updated as if my action was successful.
Navigating back to the topic list (through the previous button from my browser) and back to the category edition leads to a 404.

These navigation issues persist until I force a page refresh.

The interface shouldn’t be updated in real-time to reflect a change if that change didn’t work. :slight_smile:

4 Likes

Agree we should fix, putting a pr-welcome on this for now.

Hi @sam, I’d like to fix this.
I’m learning Rails and figure this word be a good issue to dive into a Rails code base.

Btw, I’m interested on the backend side of Rails, let me know if you know any bug I can help with:). Thanks!

Sure, feel free to give it a shot!

@sam could you review Fix: Handle failing to update parent category by DukeManh · Pull Request #24401 · discourse/discourse (github.com) please?

Do you think it needs test? If yes could you refer me to a file that does testing?

Ideally it needs a test, but even as is it is helpful … thanks @DukeManh

1 Like

I added a test and went ahead and merged it. Thanks, @DukeManh, for the contribution!

2 Likes

This topic was automatically closed after 20 hours. New replies are no longer allowed.