Cancelling "Edit Category" screen changes "Following" status


(Anton) #1

Edit a category and then cancel immediately.
If you followed category before editing, it will now show you aren’t following anymore.


(Faisal) #2

notification_level is unset when the category object is serialized and transferred to the browser. Setting it in categories_controller.rb fixes the issue. Like so.

def show
    if Category.topic_create_allowed(guardian).where(id: @category.id).exists?
      @category.permission = CategoryGroup.permission_types[:full]
    end

-> @category.notification_level = CategoryUser.where(category: @category.id).first.notification_level**

    render_serialized(@category, CategorySerializer)`
end

@sam?


(Sam Saffron) #3

Perhaps submit a PR to fix?


(Faisal) #4

Sure. just got a bit nervous being a first timer.


(Anton) #5

I’m reporting issues with pleasure, but unfortunately not able to fix them as I do not run dev instance of Discourse locally.


(Faisal) #6

Fixed with:


thanks @tgxworld.


(Alan Tan) #7

This topic was automatically closed after 2 days. New replies are no longer allowed.