Hi there!
The following commit from #2860044: Make Comment line translatable via Field setting changes the schema for comment settings on the office_hours field.
https://git.drupalcode.org/project/office_hours/-/commit/f8ccbca04054791...
We use this field in a paragraph type on the localgov_paragraphs project in the LocalGov Drupal distribution.
Our automated tests started failing due to this change, so I have updated the default configuration to address this:
https://github.com/localgovdrupal/localgov_paragraphs/pull/33/files
However, we also test an update from an older installation database dump to confirm that upgrades will work.
In this update test case our tests are now failing with something like this error:
Schema key field.storage.paragraph.localgov_contact_office_hours:settings.comment failed with: variable type is boolean but applied schema class is Drupal\Core\TypedData\Plugin\DataType\IntegerData
I am wondering if we need to write an update hook specifically to help update live configuration that uses this schema, along the lines of example 2 on this page:
https://www.drupal.org/docs/drupal-apis/update-api/updating-configuratio...
Before we look at that, I thought I would post here in case the maintainers have any better advice!
Many thanks,
Finn
Issue fork office_hours-3218789
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
Comment #2
Finn Lewis CreditAttribution: Finn Lewis as a volunteer and at Agile Collective for Oxfordshire County Council commentedComment #3
Finn Lewis CreditAttribution: Finn Lewis as a volunteer and at Agile Collective for Oxfordshire County Council commentedComment #5
johnvThe case is The the field changed from 2 to 3 options:
false / 0= no workflow comment enabled
true / 1= workflow comment enabled
n/a / 2= translatable workflow comment enabled
The third option is added, since adding the feature to (true/1) may have drawbacks on existing installations.
But the contrary occurs.
I guess your update_hook is to way to go.
Should I commit it?
Comment #6
Finn Lewis CreditAttribution: Finn Lewis as a volunteer and at Agile Collective for Oxfordshire County Council commentedHi @johnv
This change works for us and fixes the failing tests.
I made a small change to the config save, moving it up within the previous if statement, so that it only saves if we've made a change.
If you can commit and do a release, that would be great!
Many thanks,
Finn
Comment #7
johnvComment #9
johnvComment #10
johnvThanks, I will release again soon.