Overridden config from settings.php not respected

Created on 17 January 2024, 5 months ago
Updated 30 January 2024, 5 months ago

Problem/Motivation

If you override some part of the copyprevention config in your settings.php file it is not respected. In my case, it's the settings.local.php file, because I want to bypass some behaviour locally.

Steps to reproduce

Open the module Admin UI /admin/config/user-interface/copyprevention and enable some "Body tag attributes":
[√] Disable text selection: onselectstart="return false;"
[√] Disable copy to clipboard: oncopy="return false;"

Then click [Save]

Run the following drush command and confirm the configuration has been saved:

drush config:get copyprevention.settings

Add the following lines to settings.php (or settings.local.php if you are using it):

$config['copyprevention.settings']['copyprevention_body']['selectstart'] = 0;
$config['copyprevention.settings']['copyprevention_body']['copy'] = 0;

Run the following drush command to confirm the override is technically "working":

drush config:get copyprevention.settings --include-overridden

Visit your site as an anonymous user and notice that you still can't select text or copy to clipboard because the overridden config is not respected.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024