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.
Comment | File | Size | Author |
---|---|---|---|
breakpoint.patch | 1.23 KB | Anonymous (not verified) | |
Comments
Comment #2
kim.pepperTagging
Comment #3
kim.pepperTagging
Comment #4
kim.pepperOops
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedtag.
Comment #6
Jeff Burnz CreditAttribution: Jeff Burnz commentedIs this still relevant after: #1851018: Improve breakpoint configuration implementation.
Groups is like this now:
Comment #7
RainbowArrayThis 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.
Comment #8
RainbowArrayThis 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.
Comment #9
RainbowArray