Model config path uses uid instead of dot notation
In Strapi 5, to retrieve config values you will need to use config.get('plugin::upload.myconfigval') or config.get('api::myapi.myconfigval')
This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.
Is this breaking change affecting plugins?Yes
Is this breaking change automatically handled by a codemod?Partly
(see use-uid-for-config-namespace)Breaking change description
In Strapi v4
Models are added to the configuration using . notation as follows:
strapi.config.get('plugin.upload.somesetting');
if ( strapi.config.has('plugin.upload.somesetting') ) {
strapi.config.set('plugin.upload.somesetting', false);
}
In Strapi 5
Models are added to the configuration using :: replacing . notation as follows:
strapi.config.get('plugin::upload.somesetting');
if ( strapi.config.has('plugin::upload.somesetting') ) {
strapi.config.set('plugin::upload.somesetting', false);
}