Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

As a part of #1802750: [Meta] Convert configurable data to ConfigEntity system

The {shortcut_set} table was removed in favor of a new shortcut_set config entity.

Summary

  • Shortcut set becomes a classed object, Drupal\shortcut\Plugin\Core\Entity\ShortcutSet.
  • Wherever the code refers to the $set->set_name, use $set->id().
  • Wherever the code intends to output a name for the shortcut set, use $set->label().

API changes

  • const SHORTCUT_DEFAULT_SET_NAME removed and 'default' string used instead.
  • Removed shortcut_set_get_unique_name() and shortcut_set_name(), the machine names are internally verified for uniqueness
  • Removed shortcut_sets(), ShortcutSet::loadMultiple() can be used instead.
  • Shortcut set add/edit forms now use the entity form controller ShortcutSetFormController.
  • Administration page uses the entity list controller ShortcutSetListController.

Examples

<?php
// D7 code
$shortcut_sets = shortcut_sets();
$options = array();
foreach (
$shortcut_sets as $name => $set) {
 
$options[$name] = check_plain($set->title);
//...
?>
<?php
// D8 code
use Drupal\Component\Utility\String;
use
Drupal\shortcut\Entity\ShortcutSet;
$shortcut_sets = ShortcutSet::loadMultiple();
$options = array();
foreach (
$shortcut_sets as $name => $set) {
 
$options[$name] = String::checkPlain($set->label());
//...
?>

Entity API

<?php
// D7 code
$shortcut_set = shortcut_set_load(SHORTCUT_DEFAULT_SET_NAME);
?>
<?php
// D8 code
$shortcut_set = ShortcutSet::load('default');
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done

Comments

ParisLiakos’s picture

the machine names are has internal check for unique name

What do you mean here? besides that change notice seems good

andypost’s picture

That shortcut_set_load() still here