- πΊπΈUnited States danflanagan8 St. Louis, US
I just added some basic functional test coverage in π Addtocalendar could use some automated tests! Fixed that should be helpful in resolving this issue.
I added
protected $strictConfigSchema = FALSE;
to the test because indeed there are schema problems in the module. If I remove that declaration and run the test it fails with:Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for addtocalendar.settings with the following errors: addtocalendar.settings:addtocalendar_show variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData
There are other schema problems as well, as the IS notes.
Anyway, now that we have automated tests, the goal of this issue is to get those tests to run after removing the $strictConfigSchema declaration.
- Assigned to danflanagan8
- πΊπΈUnited States danflanagan8 St. Louis, US
I just applied the patch in #6 and ran the test locally with the strict schema enforced. I got a little farther I think before the test failed for a schema violation:
1) Drupal\Tests\addtocalendar\Functional\AddToCalendarTest::testAddToCalendarFormatter Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for field.field.node.page.field_addtocalendar with the following errors: field.field.node.page.field_addtocalendar:settings.addtocalendar_settings.data_calendars.iCalendar variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData, field.field.node.page.field_addtocalendar:settings.addtocalendar_settings.data_calendars.Outlook Online variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData, field.field.node.page.field_addtocalendar:settings.addtocalendar_settings.data_calendars.Yahoo! Calendar variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData
So that's one thing that needs fixing. That needs to be string though, so we'll need to update the config in the test module. I think technically that indicates we should include an update hook to force that config update on existing sites.
When I update my zeros to '0' in the test config, the tests pass! Yay!
But I also think that
field.field_settings.add_to_calendar_field
should extend the core boolean schema since our field extends that field.I'll make both of these updates.
Regarding #10 I think we should handle that in a new issue since the current test coverage does not cover that case.
- Status changed to Needs review
over 1 year ago 7:32pm 7 August 2023 - last update
over 1 year ago 1 pass - πΊπΈUnited States danflanagan8 St. Louis, US
Here's an updated patch with everything mentioned in #12.
-
danflanagan8 β
committed 7f6743b6 on 8.x-3.x authored by
kaythay β
Issue #3092765 by danflanagan8, kaythay: AddToCalendar config does not...
-
danflanagan8 β
committed 7f6743b6 on 8.x-3.x authored by
kaythay β
- Status changed to Fixed
over 1 year ago 7:48pm 7 August 2023 - πΊπΈUnited States danflanagan8 St. Louis, US
Fixed!
Thank you for the nice work, @kaythay! I noticed that the patch in #6 is simply a re-posted version of your original patch in #2.
I created a followup for the third party settings: π AddToCalendar third party settings missing schema Fixed
Automatically closed - issue fixed for 2 weeks with no activity.