Problem/Motivation

I used https://www.drupal.org/project/config_inspector on a fresh install to check the outcome before and after saving the photoswipe settings page.

For my existing installation, it contains several errors and strange values, like

  • actions Undefined undefined missing schema
  • form_build_id Undefined undefined form-UNJpKyd42W8Wa5YiVHaQtQ0Yyp7N3585EYLUSbx9PsE missing schema
  • form_token Undefined undefined I7h6ZNZNxprT9k73EojxlK9OtXvjVYrm_2WxE62UBng missing schema
  • form_id Undefined undefined photoswipe_admin_settings missing schema

. which should definitely not be there and I think came in due an issue with settings form values saving...?

Steps to reproduce

Install photoswipe
Export the configuration, see everything is fine
Save the photoswipe settings form
Export the configuration again and see the unexpected values saved.

Proposed resolution

Fix the settings form and write an update hook to remove the unwanted values.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Issue fork photoswipe-3305446

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anybody created an issue. See original summary.

anybody’s picture

Title: Settings in config present, but not configurable and perhaps unused? » Settings in config present, but not configurable and perhaps unused? Unexpected values saved

Okay, just tried to delete those unwanted keys and resaved the settings form afterwards and they are back:

diff --git a/tmp/drush_tmp_1661249099_6304a64bec6e2/photoswipe.settings.yml b/tmp/drush_tmp_1661249100_6304a64cedbfb/photoswipe.settings.yml
index 1d86e78..262e6b4 100644
--- a/tmp/drush_tmp_1661249099_6304a64bec6e2/photoswipe.settings.yml
+++ b/tmp/drush_tmp_1661249100_6304a64cedbfb/photoswipe.settings.yml
@@ -25,3 +25,7 @@ options:
   mainClass: null
   focus: true
   modal: true
+actions: null
+form_build_id: form-dtfqbeyNHOTUrCaSUuGPtJ7rOOcFIV1KCnpJZG_VtLY
+form_token: SYKTCB_qGfmt19cb0sjeE6YotvaAdTgwFnvGeXwnnes
+form_id: photoswipe_admin_settings

So this is definitely an issue.
We also need an update hook afterwards to remove them.

anybody’s picture

Title: Settings in config present, but not configurable and perhaps unused? Unexpected values saved » Config contains unexpected values after saving settings
Issue summary: View changes

anybody’s picture

Status: Active » Needs review
grevil’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

  • Anybody committed cb7d92c on 3.x
    Issue #3305446 by Anybody, Grevil: Config contains unexpected values...
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Thank you, @Grevil! Merged! :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.