diff -u b/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module --- b/core/modules/breakpoint/breakpoint.module +++ b/core/modules/breakpoint/breakpoint.module @@ -82,7 +82,7 @@ * Import media queries from a theme or module and create a default group. * * @param string $id - * Name of the breakpoint group. + * Identifier of the breakpoint group. * @param string $label * Human readable name of the breakpoint group. * @param string $sourceType @@ -156,14 +156,14 @@ $breakpoint_group->delete(); // Get all breakpoints defined by this theme/module. - $names = drupal_container()->get('config.storage')->listAll('breakpoint.breakpoint.' . $source_type . '.' . $breakpoint_group->id() . '.'); + $breakpoint_ids = drupal_container()->get('config.storage')->listAll('breakpoint.breakpoint.' . $source_type . '.' . $breakpoint_group->id() . '.'); $entity_info = entity_get_info('breakpoint'); - // Remove the breakpoint.breakpoint part of the names, before loading. - foreach ($names as &$name) { - $name = drupal_substr($name, drupal_strlen($entity_info['config prefix']) + 1); + // Remove the breakpoint.breakpoint part of the breakpoint identifier. + foreach ($breakpoint_ids as &$breakpoint_id) { + $breakpoint_id = drupal_substr($breakpoint_id, drupal_strlen($entity_info['config prefix']) + 1); } - $breakpoints = entity_load_multiple('breakpoint', $names); + $breakpoints = entity_load_multiple('breakpoint', $breakpoint_ids); // Make sure we only delete breakpoints defined by this theme/module. foreach ($breakpoints as $breakpoint) { diff -u b/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroup.php b/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroup.php --- b/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroup.php +++ b/core/modules/breakpoint/lib/Drupal/breakpoint/BreakpointGroup.php @@ -17,7 +17,7 @@ class BreakpointGroup extends ConfigEntityBase { /** - * The breakpoint group ID (machine name). + * The breakpoint group ID. * * @var string */ @@ -257,11 +257,11 @@ * Import breakpoint groups from theme or module. * * @param string $source - * Source of the breakpoint group, theme_key or module name. + * Source of the breakpoint group: theme_key or module name. * @param string $sourceType * Either Breakpoint::SOURCE_TYPE_THEME or Breakpoint::SOURCE_TYPE_MODULE. - * @param string $name - * Name of the breakpoint group. + * @param string $id + * Identifier of the breakpoint group. * @param string $label * Human readable name of the breakpoint group. * @param array $breakpoints @@ -270,20 +270,20 @@ * @return \Drupal\breakpoint\BreakpointGroup|false * Return the new breakpoint group containing all breakpoints. */ - public static function ImportBreakpointGroup($source, $source_type, $name, $label, $breakpoints) { + public static function ImportBreakpointGroup($source, $source_type, $id, $label, $breakpoints) { // Use the existing breakpoint group if it exists. - $breakpoint_group = entity_load('breakpoint_group', $source_type . '.' . $name); + $breakpoint_group = entity_load('breakpoint_group', $source_type . '.' . $id); if (!$breakpoint_group) { $breakpoint_group = entity_create('breakpoint_group', array( - 'id' => $name, - 'label' => !empty($label) ? $label : $name, + 'id' => $id, + 'label' => !empty($label) ? $label : $id, 'source' => $source, 'sourceType' => $source_type, )); } else { // Reset label. - $breakpoint_group->label = !empty($label) ? $label : $name; + $breakpoint_group->label = !empty($label) ? $label : $id; } // Add breakpoints to the group.