Krzysztof Kotlarek 38ab45cb93
FIX: check min tag count requirement when change category (#12252)
When a category is created, we can set `minimum_required_tags` property.

When the topic is created, we are checking that field and ensuring that the minimum amount of tags were added - unless topic created by a staff member.

Problem is that validation is skipped when we change the category from for example category with 0 tags required to the category with 1 tag required.

Changing category is kind of the unicorn as it is a complicated operation:

https://github.com/discourse/discourse/blob/master/lib/post_revisor.rb#L84

https://github.com/discourse/discourse/blob/master/app/models/topic.rb#L911

https://github.com/discourse/discourse/blob/master/app/models/topic.rb#L823

Before we start to try to change the category, we should ensure that the tags requirement is fulfilled.

https://meta.discourse.org/t/the-category-setting-for-tags-is-not-respected/181214
2021-03-03 10:59:23 +11:00
..
2021-03-02 17:11:14 +00:00
2020-01-15 11:27:12 +01:00
2020-04-30 16:48:53 +10:00
2020-05-05 13:46:57 +10:00
2019-05-22 17:39:44 +03:00
2020-05-05 13:46:57 +10:00
2020-07-21 15:55:03 +08:00
2021-02-18 14:21:37 -05:00
2020-04-30 16:48:53 +10:00