0

I am trying to do a really low-hassle update of config schema for my module:

  1. I updated files
    • form: modules/custom/mymod/config/schema/mymod.schema.yml
    • data: modules/custom/mymod/config/install/mymod.config.yml
  2. I pushed the changes to working state
    • drush cr (automagically absorbs the schema)
    • drush cim -y --partial --source=modules/custom/mymod/config/install
    • drush cr, just in case

(I understand the concept of using hook_update_N to eg. pack in new data and translate old data into new form, but I really don't need such heavy lifting.)

When I inspect the configuration, for example by using Config Inspector Module - it displays correct input masks, data from the yaml, states the validation is fine.

But, when I go to admin/config/mymod page, I still see the old input masks.

The configuration form is not generated from schema, the module has to supply it. So I found out, I have it under src/form/ConfigurationForm.php. When I don't implement buildForm() method, it just stays empty.

Is there a way to let drupal auto generate the configuration form? There must already be plenty of standard iterators in drupal which transform such into such. The Config Inspector Module does it - it's just probably not worth for me alone the hassle to dissect it. Is there a standard procedure to this?

  • I can kind of follow what you are saying... but not quite. I think your post is almost there, but maybe have a re-read and try to make it more concise, and with a few code examples. – Jaypan Feb 29 at 2:16

Your Answer

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

Browse other questions tagged or ask your own question.