during config import, the BreakpointGroup entity's loadAllBreakpoints() method is called before the breakpoints property is populated with values from it's config object.

the import code sets the BreakpointGroup::breakpoints with the simple list of breakpoint names from the config file, which breaks any code assuming BreakpointGroup::breakpoints has a list of loaded Breakpoint objects in it.

the BreakpointGroup::save() method is code that assumes BreakpointGroup::breakpoints is fully loaded with objects, so it saves the array keys only to the config file.

thus, when BreakpointGroup::save() is called during import, we save:

id: module.toolbar.toolbar
uuid: e55f6e1d-ba89-470d-9901-1fd2fcf5692f
name: toolbar
label: toolbar
breakpoints:
  - '0'
  - '1'
  - '2'
source: toolbar
sourceType: module
status: '1'
langcode: und

instead of:

id: module.toolbar.toolbar
uuid: e55f6e1d-ba89-470d-9901-1fd2fcf5692f
name: toolbar
label: toolbar
breakpoints:
  - module.toolbar.narrow
  - module.toolbar.standard
  - module.toolbar.wide
source: toolbar
sourceType: module
status: '1'
langcode: und

cool story, huh?

so this patch adds special handling to BreakpointGroup::set() when the property is 'breakpoints', to ensure that we always load the Breakpoint config entities into BreakpointGroup::breakpoints.

not at all sure if this is the right approach, but kim.pepper and boztek and i spent half a day tracking it down at the sydney code sprint.

Files: 
CommentFileSizeAuthor
breakpoint.patch1.23 KBbeejeebus
FAILED: [[SimpleTest]]: [MySQL] 52,631 pass(es), 141 fail(s), and 28 exception(s). View

Comments

Status: Needs review » Needs work

The last submitted patch, breakpoint.patch, failed testing.

kim.pepper’s picture

Version: 8.x-dev » 7.x-dev
Component: configuration entity system » configuration system

Tagging

kim.pepper’s picture

Tagging

kim.pepper’s picture

Version: 7.x-dev » 8.x-dev
Component: configuration system » configuration entity system

Oops

beejeebus’s picture

Issue tags: +Configuration system

tag.

Jeff Burnz’s picture

Is this still relevant after: #1851018: Improve breakpoint configuration implementation.

Groups is like this now:

id: theme.at_core.at_core
uuid: 7f6492dc-028c-47e9-bb00-c280cc2158jb
name: at_core
label: Adaptivetheme
breakpoint_ids:
  - theme.at_core.mobile
  - theme.at_core.narrow
  - theme.at_core.wide
source: at_core
sourceType: theme
status: true
langcode: en
mdrummond’s picture

Status: Needs work » Needs review

This comment implies that this issue has been fixed: https://drupal.org/comment/8009349#comment-8009349

Can somebody confirm that? If so, I would imagine this issue can be closed as fixed.

mdrummond’s picture

This is no longer relevant now that Breakpoint now longer has configuration entities due to #2271529: Move breakpoint settings to theme and module *.breakpoints.yml files at root level.

mdrummond’s picture

Status: Needs review » Closed (won't fix)