- Issue created by @johnwt
- 🇮🇳India Raveen Kumar
I have installed the module using composer require 'drupal/csp:^2.2'
I am using drupal latest version i.e, Drupal : 11.1.5On visit of - admin/config/system/csp , I was able to access config form. As you can see my attached screenshot.
Could you please confirm if issue still persists here.
And Thank You!!
I have the same, i.e. Drupal : 11.1.5 and csp installed with composer require 'drupal/csp:^2.2', and the error persists.
- 🇨🇦Canada gapple
The form is trying to indicate that there is an issue with your policy's reporting configuration
https://git.drupalcode.org/project/csp/-/blob/2.x/src/Form/CspSettingsFo...What are the values in your configuration for
csp.settings:enforce.reporting
andcsp.settings:report-only.reporting
? I am facing the same issue.
I am on Drupal: 11.1.6, CSP: 2.2.2The screenshot attached shows my configuration object.
Under which object would I find the following settings
csp.settings:enforce.reporting
csp.settings:report-only.reporting
Please let me know, if you need more information.
ThanksI am facing the same issue
I am on drupal.core: 11.1.6, drupal/csp: 2.2.2The screenshot below shows my configuration object.
Where would I find the said properties?
csp.settings:enforce.reporting
csp.settings:report-only.reporting
- 🇨🇦Canada gapple
@sudhanshu.b Your configuration looks ridiculously old (like, the format is pre 8.x-1.0), and has not had necessary updates run for over 6 years.
However, nothing in the module is enabled, so it would be easier to just uninstall and re-install the CSP module to reset it to default configuration. @gapple I tried uninstalling - reinstalling the module version 2.2.2 using drush for the website, as well as using composer. But saw no improvement. The issue still persists.
My database contains this under csp.settings in hex format.
{ "_core": { "default_config_hash": "hRfZ8Hy0OO_H_xuVoHK6yrwiNH3bSgtmzUvg46YVHJ0" }, "enforce": false, "report": { "handler": "csp-module" } }
I have tried installing CSP version 8.x-1.40, which seems to work as expected and has the following csp.settings:
{ "_core": { "default_config_hash": "hRfZ8Hy000_H_xuVoHK6yrwiNH3bSgtmzUvg46YVHJ0", "enforce": False, "report": { "handler": "csp-module" } }, "report-only": { "enable": False, "directives": { "script-src": {"base": "self"}, "script-src-attr": {"base": "self"}, "script-src-elem": {"base": "self"}, "style-src": {"base": "self"}, "style-src-attr": {"base": "self"}, "style-src-elem": {"base": "self"}, "frame-ancestors": {"base": "self"} }, "reporting": {"plugin": "none"} }, "enforce": { "enable": False, "directives": { "script-src": {"base": "self"}, "script-src-attr": {"base": "self"}, "script-src-elem": {"base": "self"}, "style-src": {"base": "self"}, "style-src-attr": {"base": "self"}, "style-src-elem": {"base": "self"}, "frame-ancestors": {"base": "self"} }, "reporting": {"plugin": "none"} } }
However, we prefer to use the latest version (^2.0). Could I be missing certain steps when installing CSP? Or it would be because of certain other dependencies?
Thanks.@gapple, when you wrote "What are the values in your configuration for csp.settings:enforce.reporting and csp.settings:report-only.reporting?" were you referring to settings in the configuration file that should be at https:///admin/config/system/csp? This file is inaccessible because of this issue or is absent.
Other issues resulting in the above TypeError seem to be resolved by eliminating the offending null value.- 🇨🇦Canada gapple
@sudhanshu.b
The configurations you posted do not match the module's default installed config for either 2.2.2 [https://git.drupalcode.org/project/csp/-/blob/2.2.2/config/install/csp.s... or 8.x-1.40 [https://git.drupalcode.org/project/csp/-/blob/8.x-1.40/config/install/cs...(e.g. both have the report-only policy enabled by default), so I am not sure what is occurring with your site.@johnwt
You can read the config options directly with drush:
drush cget csp.settings enforce.reporting
drush cget csp.settings report-only.reporting
or through the single item config export in the admin section at
/admin/config/development/configuration/single/export
The values should match those from the install config, if you haven't had CSP installed previously and changed the values.
I cannot reproduce any issues with the module's configuration on a clean install, or after applying updates to an older configuration.
@gapple, thanks for the drush suggestion. This confirms that csp.settings is not being installed. I have tried completely uninstalling and reinstalling the module but the error persists. I get a WSOD when installing the module using extend, dblog mainly reports a lot of
non-existent config entity name
errors.I have managed to deal with the non-existant config errors and it is working now, so this is fixed as far as I am concerned. Thanks.