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 file
  • Verify that nowhere in the code relies on the value being an integer instead of a boolean, update if they do
  • Write 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.

Comments

alexdmccabe created an issue. See original summary.

alexdmccabe’s picture

Status: Active » Needs review
StatusFileSize
new1.64 KB
alexdmccabe’s picture

Issue summary: View changes
alexdmccabe’s picture

Issue summary: View changes
alexdmccabe’s picture

Issue summary: View changes
thalles’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +ciandt-contrib, +#ciandt-contrib

Hi @alexdmccabe, here it works!

renatog’s picture

I applied the patch and really works good

+1 to it

  • RenatoG committed b9a5bb3 on 8.x-1.x authored by alexdmccabe
    Issue #3006275 by alexdmccabe, thalles, RenatoG: home_segment_keep...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the dev branch.

Best,

Status: Fixed » Closed (fixed)

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