openeuropa / oe_whitelabel

European Union Public License 1.2
2 stars 4 forks source link

Release 1.8 overrides project configs #299

Closed Aporie closed 3 months ago

Aporie commented 3 months ago

Hi guys,

I'd like to point what seems to me a dangerous line of code introduced in 1.8.

https://github.com/openeuropa/oe_whitelabel/blob/1.x/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.post_update.php#L64

/**
 * Show the gallery field in project full view mode.
 */
function oe_whitelabel_extra_project_post_update_00003(): void {
  ConfigImporter::importSingle('module', 'oe_whitelabel_extra_project', '/config/post_updates/00003_gallery_field', 'core.entity_view_display.node.oe_project.full');
}

Reimporting the default config with few changes will definitely erase our configs on customized projects. It's mitigated because it's only view and not storage but still. Might not be seen by the dev, and pages will become broken/obsolete.

brummbar commented 3 months ago

Hi @Aporie , in OpenEuropa the content type modules (e.g. oe_content, oe_starter_content) and the themes work under the assumption that they own the config related to the content types they provide/style. This means that we do update the view modes for our content types. Unlike specific scenarios, final users will have their website configuration exported in the config sync folder, especially view modes. This means that is part of their tasks to validate the changes before committing.

brummbar commented 3 months ago

Closing as it works as intended.