Topics failing validation after migration throw '422' error instead of "nice" message

(Joshua Rosenfeld) #1

When data is migrated from another software platform it is possible that topics migrated would be considered “invalid” if created on Discourse. Common causes of “invalid” topics are min topic title length, max topic title length, and title max word length. If a user attempts to edit these topics (including changing category) they receive a 422 error, instead of the standard Title seems unclear, is it a complete sentence?.

Further, it’d be great if we could share the specific cause of the error (word is too long, for example) instead of the vague “title seems unclear”.

(Jeff Atwood) #2

Do they also get 422 if they edit the title? Or is this specific to changing category?

(Joshua Rosenfeld) #3

I’m not able to consistently reproduce this on try, so I’m not sure. I created a topic with a 28 character word in the title (limit is 30), submitted, waited 5 minutes, lowered the site setting to a 20 character limit, then changed the category without error (which should have failed?). Attempting to add to the title gave the expected Title seems unclear, is it a complete sentence? error. If I modified the title and changed the category I received a 422 error, but this is not consistent with what I first saw.

(Jeff Atwood) #5

So as suspected this has to do with category only edits triggering validation on the title. So only the topic owner, staff, or TL3 could really run into this.