CORS configuration update should be distinct from configuration save

Created on 8 September 2022, over 2 years ago
Updated 10 December 2024, 2 months ago

Problem/Motivation

The save configuration button combines the functionality of saving configuration in addition to posting the CORS update to the backend provider. This can cause problems when you are overriding the configuration values in settings.

Steps to reproduce

Provide a configuration override for e.g. the CORS origin in your settings.php, such as:
$config['s3fs_cors.settings']['s3fs_cors_origin'] = 'override.example.com';
In the admin ui, click save settings, and any value entered in the configuration page (e.g. default.example) will be used, instead of the override value from settings. Additionally, any issue applying the settings is not being handled.

Proposed resolution

  1. Make the configuration save button only save configuration
  2. Add an additional button to post the CORS configuration, which can get read the active configuration
  3. Try/catch the CORS post and report failures

Remaining tasks

  • Review solution and messages/interface wording
  • Patch review

User interface changes

  • Add an additional button "Update CORS"
  • Improve error reporting/messaging

API changes

Nothing external - all changes are in configuration form.

Data model changes

None, though note this is explicitly (in part) to ensure the configuration data can be overridden successfully.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States wolcen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024