diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index cbdbda7..34678f7 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -169,8 +169,7 @@ function contact_config_import_change($name, $new_config, $old_config) { return FALSE; } - // @todo Make this less ugly. - $id = substr($name, strlen(Category::getConfigPrefix()) + 1); + list(, , $id) = explode('.', $name); $category = entity_load('contact_category', $id); $category->original = clone $category; @@ -194,7 +193,7 @@ function contact_config_import_delete($name, $new_config, $old_config) { return FALSE; } - $id = substr($name, strlen(ConfigTest::getConfigPrefix()) + 1); + list(, , $id) = explode('.', $name); entity_delete_multiple('contact_category', array($id)); return TRUE; } diff --git a/core/modules/contact/lib/Drupal/contact/Category.php b/core/modules/contact/lib/Drupal/contact/Category.php index dac5c33..70d2742 100644 --- a/core/modules/contact/lib/Drupal/contact/Category.php +++ b/core/modules/contact/lib/Drupal/contact/Category.php @@ -14,8 +14,25 @@ */ class Category extends ConfigurableBase { + /** + * The category ID. + * + * @var string + */ public $id; + + /** + * The category UUID. + * + * @var string + */ public $uuid; + + /** + * The category label. + * + * @var string + */ public $label; /** @@ -39,10 +56,4 @@ class Category extends ConfigurableBase { */ public $weight = 0; - /** - * Implements Drupal\Core\Configurable\ConfigurableInterface::getConfigPrefix(). - */ - public static function getConfigPrefix() { - return 'contact.category'; - } }