1

One of the recent Craft updates (something close to 3.1.25) also brought a redactor migration (https://github.com/craftcms/redactor/blob/v2/src/migrations/m190225_003922_split_cleanup_html_settings.php), which fails when those 2 configs are disabled:

'allowAdminChanges' => false, 'useProjectConfigFile' => false, 

The reason why it fails is that the migration tries to do something with projectConfig, which is read only when allowAdminChanges is disabled.

1 Answer 1

2

According to P&T this is expected behavior. Their solution is to put this in config/app.php:

'components' => [ 'projectConfig' => function() { $config = craft\helpers\App::projectConfigConfig(); $config['readOnly'] = false; return Craft::createObject($config); }, ], 

(Thanks Oli, Brandon, Andris!)

Since I do all migration via Craft's console commands, this shorter solution works for me:

'allowAdminChanges' => (php_sapi_name() === 'cli') 

It simply enables admin changes when using the console command.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.