Commit d41d3db0 authored by catch's avatar catch

Issue #2199483 by damiankloip, alexpott: Provide a default config_prefix based...

Issue #2199483 by damiankloip, alexpott: Provide a default config_prefix based on entity type ID and provider.
parent c1e2a47d
...@@ -34,7 +34,18 @@ public function getControllerClasses() { ...@@ -34,7 +34,18 @@ public function getControllerClasses() {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getConfigPrefix() { public function getConfigPrefix() {
return isset($this->config_prefix) ? $this->config_prefix : FALSE; if (isset($this->config_prefix)) {
$config_prefix = $this->config_prefix;
}
else {
$config_prefix = $this->id();
}
// Ensure that all configuration entities are prefixed by the module that
// provides the configuration entity type. This ensures that default
// configuration will be created as expected during module install and
// dependencies can be calculated without the modules that provide the
// entity types being installed.
return $this->provider . '.' . $config_prefix;
} }
/** /**
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* "list" = "Drupal\custom_block\CustomBlockTypeListController" * "list" = "Drupal\custom_block\CustomBlockTypeListController"
* }, * },
* admin_permission = "administer blocks", * admin_permission = "administer blocks",
* config_prefix = "custom_block.type", * config_prefix = "type",
* bundle_of = "custom_block", * bundle_of = "custom_block",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
* "delete" = "Drupal\block\Form\BlockDeleteForm" * "delete" = "Drupal\block\Form\BlockDeleteForm"
* } * }
* }, * },
* config_prefix = "block.block",
* admin_permission = "administer blocks", * admin_permission = "administer blocks",
* fieldable = FALSE, * fieldable = FALSE,
* entity_keys = { * entity_keys = {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* @ConfigEntityType( * @ConfigEntityType(
* id = "breakpoint", * id = "breakpoint",
* label = @Translation("Breakpoint"), * label = @Translation("Breakpoint"),
* config_prefix = "breakpoint.breakpoint",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* @ConfigEntityType( * @ConfigEntityType(
* id = "breakpoint_group", * id = "breakpoint_group",
* label = @Translation("Breakpoint group"), * label = @Translation("Breakpoint group"),
* config_prefix = "breakpoint.breakpoint_group",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -83,5 +83,5 @@ function config_test_entity_type_alter(array &$entity_types) { ...@@ -83,5 +83,5 @@ function config_test_entity_type_alter(array &$entity_types) {
unset($keys['status']); unset($keys['status']);
$config_test_no_status->set('id', 'config_test_no_status'); $config_test_no_status->set('id', 'config_test_no_status');
$config_test_no_status->set('entity_keys', $keys); $config_test_no_status->set('entity_keys', $keys);
$config_test_no_status->set('config_prefix', 'config_test.no_status'); $config_test_no_status->set('config_prefix', 'no_status');
} }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* "default" = "Drupal\config_test\ConfigTestFormController" * "default" = "Drupal\config_test\ConfigTestFormController"
* } * }
* }, * },
* config_prefix = "config_query_test.dynamic", * config_prefix = "query",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* }, * },
* "access" = "Drupal\config_test\ConfigTestAccessController" * "access" = "Drupal\config_test\ConfigTestAccessController"
* }, * },
* config_prefix = "config_test.dynamic", * config_prefix = "dynamic",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* "delete" = "Drupal\contact\Form\CategoryDeleteForm" * "delete" = "Drupal\contact\Form\CategoryDeleteForm"
* } * }
* }, * },
* config_prefix = "contact.category", * config_prefix = "category",
* admin_permission = "administer contact forms", * admin_permission = "administer contact forms",
* bundle_of = "contact_message", * bundle_of = "contact_message",
* entity_keys = { * entity_keys = {
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
* @ConfigEntityType( * @ConfigEntityType(
* id = "editor", * id = "editor",
* label = @Translation("Editor"), * label = @Translation("Editor"),
* config_prefix = "editor.editor",
* entity_keys = { * entity_keys = {
* "id" = "format", * "id" = "format",
* "uuid" = "uuid" * "uuid" = "uuid"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* @ConfigEntityType( * @ConfigEntityType(
* id = "entity_form_display", * id = "entity_form_display",
* label = @Translation("Entity form display"), * label = @Translation("Entity form display"),
* config_prefix = "entity.form_display", * config_prefix = "form_display",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "uuid" = "uuid", * "uuid" = "uuid",
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
* } * }
* }, * },
* admin_permission = "administer display modes", * admin_permission = "administer display modes",
* config_prefix = "entity.form_mode",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -19,7 +19,10 @@ ...@@ -19,7 +19,10 @@
* @ConfigEntityType( * @ConfigEntityType(
* id = "entity_view_display", * id = "entity_view_display",
* label = @Translation("Entity view display"), * label = @Translation("Entity view display"),
* config_prefix = "entity.view_display", * controllers = {
* "storage" = "Drupal\Core\Config\Entity\ConfigStorageController"
* },
* config_prefix = "view_display",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "uuid" = "uuid", * "uuid" = "uuid",
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
* } * }
* }, * },
* admin_permission = "administer display modes", * admin_permission = "administer display modes",
* config_prefix = "entity.view_mode",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* controllers = { * controllers = {
* "storage" = "Drupal\field\FieldConfigStorageController" * "storage" = "Drupal\field\FieldConfigStorageController"
* }, * },
* config_prefix = "field.field", * config_prefix = "field",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "id", * "label" = "id",
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* controllers = { * controllers = {
* "storage" = "Drupal\field\FieldInstanceConfigStorageController" * "storage" = "Drupal\field\FieldInstanceConfigStorageController"
* }, * },
* config_prefix = "field.instance", * config_prefix = "instance",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* "list" = "Drupal\filter\FilterFormatListController", * "list" = "Drupal\filter\FilterFormatListController",
* "access" = "Drupal\filter\FilterFormatAccessController", * "access" = "Drupal\filter\FilterFormatAccessController",
* }, * },
* config_prefix = "filter.format", * config_prefix = "format",
* admin_permission = "administer filters", * admin_permission = "administer filters",
* entity_keys = { * entity_keys = {
* "id" = "format", * "id" = "format",
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
* "list" = "Drupal\image\ImageStyleListController", * "list" = "Drupal\image\ImageStyleListController",
* }, * },
* admin_permission = "administer image styles", * admin_permission = "administer image styles",
* config_prefix = "image.style", * config_prefix = "style",
* entity_keys = { * entity_keys = {
* "id" = "name", * "id" = "name",
* "label" = "label", * "label" = "label",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* } * }
* }, * },
* admin_permission = "administer languages", * admin_permission = "administer languages",
* config_prefix = "language.entity", * config_prefix = "entity",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
* "delete" = "Drupal\Core\Entity\EntityFormController" * "delete" = "Drupal\Core\Entity\EntityFormController"
* } * }
* }, * },
* config_prefix = "migrate.migration",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* "list" = "Drupal\node\NodeTypeListController", * "list" = "Drupal\node\NodeTypeListController",
* }, * },
* admin_permission = "administer content types", * admin_permission = "administer content types",
* config_prefix = "node.type", * config_prefix = "type",
* bundle_of = "node", * bundle_of = "node",
* entity_keys = { * entity_keys = {
* "id" = "type", * "id" = "type",
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* }, * },
* list_path = "admin/config/media/picturemapping", * list_path = "admin/config/media/picturemapping",
* admin_permission = "administer pictures", * admin_permission = "administer pictures",
* config_prefix = "picture.mappings", * config_prefix = "mappings",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* @ConfigEntityType( * @ConfigEntityType(
* id = "rdf_mapping", * id = "rdf_mapping",
* label = @Translation("RDF mapping"), * label = @Translation("RDF mapping"),
* config_prefix = "rdf.mapping", * config_prefix = "mapping",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "uuid" = "uuid" * "uuid" = "uuid"
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* "disable" = "search.disable", * "disable" = "search.disable",
* "set-default" = "search.set_default" * "set-default" = "search.set_default"
* }, * },
* config_prefix = "search.page", * config_prefix = "page",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* "delete" = "Drupal\shortcut\Form\ShortcutSetDeleteForm" * "delete" = "Drupal\shortcut\Form\ShortcutSetDeleteForm"
* } * }
* }, * },
* config_prefix = "shortcut.set", * config_prefix = "set",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* id = "action", * id = "action",
* label = @Translation("Action"), * label = @Translation("Action"),
* admin_permission = "administer actions", * admin_permission = "administer actions",
* config_prefix = "system.action",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
* "delete" = "Drupal\system\Form\DateFormatDeleteForm" * "delete" = "Drupal\system\Form\DateFormatDeleteForm"
* } * }
* }, * },
* config_prefix = "system.date_format",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* controllers = { * controllers = {
* "access" = "Drupal\system\MenuAccessController" * "access" = "Drupal\system\MenuAccessController"
* }, * },
* config_prefix = "system.menu",
* admin_permission = "administer menu", * admin_permission = "administer menu",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* } * }
* }, * },
* admin_permission = "administer taxonomy", * admin_permission = "administer taxonomy",
* config_prefix = "taxonomy.vocabulary", * config_prefix = "vocabulary",
* bundle_of = "taxonomy_term", * bundle_of = "taxonomy_term",
* entity_keys = { * entity_keys = {
* "id" = "vid", * "id" = "vid",
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* controllers = { * controllers = {
* "view_builder" = "Drupal\tour\TourViewBuilder" * "view_builder" = "Drupal\tour\TourViewBuilder"
* }, * },
* config_prefix = "tour.tour",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* } * }
* }, * },
* admin_permission = "administer permissions", * admin_permission = "administer permissions",
* config_prefix = "user.role", * config_prefix = "role",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "uuid" = "uuid", * "uuid" = "uuid",
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* "access" = "Drupal\views\ViewAccessController" * "access" = "Drupal\views\ViewAccessController"
* }, * },
* admin_permission = "administer views", * admin_permission = "administer views",
* config_prefix = "views.view",
* entity_keys = { * entity_keys = {
* "id" = "id", * "id" = "id",
* "label" = "label", * "label" = "label",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment