Problem/Motivation
The home_segment_keep config setting is a boolean on/off switch, to the point that even in easy_breadcrumb.settings.yml, the default value for home_segment_keep is FALSE.
However, the schema registers it as an integer, which isn't the best practice, is inconsistent with the rest of the schema, and can throw errors during PHPUnit tests:
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for
easy_breadcrumb.settings with the following errors:
easy_breadcrumb.settings:home_segment_keep variable type is boolean but
applied schema class is Drupal\Core\TypedData\Plugin\DataType\IntegerData
In my particular use case, I got that error by creating a service in a custom module that decorates the original easy_breadcrumb.breadcrumb service in order to override some of the methods. My custom module's PHPUnit tests then started throwing the SchemaIncompleteException error.
Proposed resolution
Change the type from integer to boolean.
Remaining tasks
Update the schema fileVerify that nowhere in the code relies on the value being an integer instead of a boolean, update if they doWrite an update hook to convert existing installs from integer to boolean
User interface changes
N/A
API changes
N/A
Data model changes
home_segment_keep will change from integer to boolean.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | easy_breadcrumb-home_segment_keep_boolean-3006275-2-8.patch | 1.64 KB | alexdmccabe |
Comments
Comment #2
alexdmccabeComment #3
alexdmccabeComment #4
alexdmccabeComment #5
alexdmccabeComment #6
thallesHi @alexdmccabe, here it works!
Comment #7
renatog commentedI applied the patch and really works good
+1 to it
Comment #9
renatog commentedCommitted to the dev branch.
Best,