Skip to content

fix(cms): ensure article template populates for new groups

Ben Whitmore requested to merge cms-populate-for-new-groups-20240215 into main

Previously, a migration was implemented to patch CMS article templates for existing groups. The trouble is, when setting up a new instance of Kotahi this migration runs before any groups have been created. There are thus no records to patch. The groups and article template records were created at a later point. Thus, a new instance of Kotahi would have no article templates populated for CMS.

I've removed the migration and instead added a seed script that will either patch existing CMS article template records if the template is empty, or will insert completely new records if records are missing.

This will run at every server startup, and patch or insert only as necessary. One bonus of this is that if you really mess up your article template you can clear it entirely then restart the server and it will be restored to default.

Merge request reports