1

I have a plugin/module that synchronises local records with a Google Sheet managed by the client. The URL for this doc is stored in a module config.

I want the client to be able to update this via the control panel so have created a template for editing and a controller to update the config. This is all fine locally but in the client environment where allowAdminChanges is set to false this won't save and I get the following error:

 Changes to the project config are not possible while in read-only mode.

I have tried both Craft::$app->projectConfig->set('my-module', $settings); and Craft::$app->getSystemSettings()->saveSettings('mud-module', $settings) with same ersponse.

Is there a way to update config when allowAdminChanges is set to 0/false?

2

In short, no. If this is config or data which are environment specific, they are as likely not good candidates for project config. Perhaps consider moving them to a table and access them through a Record/Model?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.