Is it possible to disable all title/body validations?

AI-generated summary

A user, meriksson, is developing a script to import a large number of posts into Discourse. However, they are encountering issues with title and body validations, such as posts being rejected due to unusual characters or short lengths. Despite adjusting settings, they are struggling to find a solution.

meriksson is seeking a way to disable all validations for the purpose of the import, or a list of relevant settings to adjust. They cannot modify the posts being imported or skip problematic ones, as this would cause issues with replies and dependencies.

sam suggested using the base importer, which skips validations, as a solution. meriksson found this advice helpful and plans to implement it in their script.

I am working on a script for importing large numbers of posts into Discourse. I have been spending a lot of time managing problems like title or body fields being too short, titles being all-caps, titles consisting of unusual characters etc. For some I have found settings, e.g. allowing all-caps titles. But I still have some special cases causing trouble, like posts with this body: “?” Despite setting min_post_length to 1, this is rejected and if I understand correctly this has to do with it being specifically a question mark. In any case, I have run into several of these cases with no obvious way of dealing with them by changing a setting.

My question is if it is possible to disable all similar validations, e.g. the Sentinel features and related things, and instead simply accept any string for the one-off purpose of running a batch importing job. If not, is there a list of all individual settings which are relevant to this? I have spent some time searching this forum and elsewhere but have had no luck so far. Sorry if this is old hat to you guys, in that case I would be very grateful for a pointer to where this has been explained.

Note that writing posts differently is not an option for me since I am importing tens of thousands of posts which are like they are. I certainly want to have those features, just not during the initial import. I also can not skip posts just because the are weird (e.g. consist of “?”) since this would cause other issues, e.g. in some cases such posts have replies made to them and I need to import the parent to properly import the children etc.

PS. I will be publishing an extensive update to an import script which I know will be useful to many who are in a similar situation, I just need to iron out a few more kinks first. The deadline for the stuff I am working on for my own project is December 31 and I plan to make a pull request to an existing but not well updated importer project in January.

Most importers skip validations by using the base importer.

Brilliant! Looks like exactly the thing I am after. Thank you very much, @sam!