Problem/Motivation

The format of multipliers array in the breakpoint.*.yml files is

multipliers:
  1x: 1x

This is repetitive, and should be

multipliers:
  - 1x
  - 1.5x
  - 2x

Proposed resolution

Fix the breakpoint config set to only save allowed multipliers, and to match the format of the sequence with the -

Remaining tasks

discuss proposed resolution
implement

User interface changes

No UI changes.

API changes

No API changes.

Steps to reproduce

View an example breakpoint file:

core/modules/toolbar/config/breakpoint.breakpoint.module.toolbar.wide.yml
sites/default/files/config_*/active/breakpoint.breakpoint.theme.bartik.wide.yml

Original report by @vijaycs85

Follow up for #1912308-28: Create configuration schemas for breakpoint module
Similar to #1933548: Book allowed_types settings repetitive and in under certain conditions can change unexpectedly

Files: 
CommentFileSizeAuthor
#7 breakpoint-repetitive-multipliers-1945228-7.patch5.67 KBandrei.dincu
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 64,832 pass(es). View

Comments

YesCT’s picture

tagging novice for the task of using the issue summary template here.

xjm’s picture

farfanfelipe’s picture

I would like to help with this issue but I do not understand properly the problem.

ianthomas_uk’s picture

Issue summary: View changes

Updated issue summary.

ianthomas_uk’s picture

I think I've cleared up the issue summary as much as I can, but I've still got a few questions.

1. When are files such as breakpoint.breakpoint.module.bartik.wide.yml regenerated? As far as I can tell there isn't a UI I can just click Save in.
2. If I understand correctly, this change will require minor updates to any code that respects this multiplier setting (to change isset($array[$key]) to in_array($key, $array)). Is this still allowed in Drupal 8? Affected core modules are breakpoint and picture.
3. Similarly, if any themes have defined the multipliers they support then they will need to be updated. Is this still allowed?

I'm happy to work towards a patch if someone can help with 1 and 2/3 are not a problem.

ianthomas_uk’s picture

Issue summary: View changes

Updated issue summary.

thrnio’s picture

Updating the summary as breakpoint.settings.yml was removed in e0a0b7 because it was unused, per #1851018-23: Improve breakpoint configuration implementation..

andrei.dincu’s picture

Assigned: Unassigned » andrei.dincu
Status: Active » Needs work
andrei.dincu’s picture

FileSize
5.67 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 64,832 pass(es). View
andrei.dincu’s picture

Status: Needs work » Needs review
Cameron Tod’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Doesn't appear to need any config schema changes.

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, but this is not enough. As #4 points out, we have to update the code to account for this changed configuration. I just found Breakpoint::save() as one example which needs to be updated.

lokapujya’s picture

Currently, if you export the .yml, the file is generated as exists in Git. If you then manually update the .yml file as done in #7, then synchronize the .yml and re-export the .yml file, you get:
multipliers:
1x: 1x
0: 1x
1: 1.5x
2: 2x

attiks’s picture

Status: Needs work » Postponed

Postponing since the whole system of breakpoints is going to change, see #2271529: Move breakpoint settings to theme and module *.breakpoints.yml files at root level

attiks’s picture

Status: Postponed » Closed (won't fix)