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() {
* {@inheritdoc}
*/
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 @@
* "list" = "Drupal\custom_block\CustomBlockTypeListController"
* },
* admin_permission = "administer blocks",
* config_prefix = "custom_block.type",
* config_prefix = "type",
* bundle_of = "custom_block",
* entity_keys = {
* "id" = "id",
......
......@@ -27,7 +27,6 @@
* "delete" = "Drupal\block\Form\BlockDeleteForm"
* }
* },
* config_prefix = "block.block",
* admin_permission = "administer blocks",
* fieldable = FALSE,
* entity_keys = {
......
......@@ -21,7 +21,6 @@
* @ConfigEntityType(
* id = "breakpoint",
* label = @Translation("Breakpoint"),
* config_prefix = "breakpoint.breakpoint",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -18,7 +18,6 @@
* @ConfigEntityType(
* id = "breakpoint_group",
* label = @Translation("Breakpoint group"),
* config_prefix = "breakpoint.breakpoint_group",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -83,5 +83,5 @@ function config_test_entity_type_alter(array &$entity_types) {
unset($keys['status']);
$config_test_no_status->set('id', 'config_test_no_status');
$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 @@
* "default" = "Drupal\config_test\ConfigTestFormController"
* }
* },
* config_prefix = "config_query_test.dynamic",
* config_prefix = "query",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -25,7 +25,7 @@
* },
* "access" = "Drupal\config_test\ConfigTestAccessController"
* },
* config_prefix = "config_test.dynamic",
* config_prefix = "dynamic",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -26,7 +26,7 @@
* "delete" = "Drupal\contact\Form\CategoryDeleteForm"
* }
* },
* config_prefix = "contact.category",
* config_prefix = "category",
* admin_permission = "administer contact forms",
* bundle_of = "contact_message",
* entity_keys = {
......
......@@ -16,7 +16,6 @@
* @ConfigEntityType(
* id = "editor",
* label = @Translation("Editor"),
* config_prefix = "editor.editor",
* entity_keys = {
* "id" = "format",
* "uuid" = "uuid"
......
......@@ -17,7 +17,7 @@
* @ConfigEntityType(
* id = "entity_form_display",
* label = @Translation("Entity form display"),
* config_prefix = "entity.form_display",
* config_prefix = "form_display",
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
......
......@@ -40,7 +40,6 @@
* }
* },
* admin_permission = "administer display modes",
* config_prefix = "entity.form_mode",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -19,7 +19,10 @@
* @ConfigEntityType(
* id = "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 = {
* "id" = "id",
* "uuid" = "uuid",
......
......@@ -40,7 +40,6 @@
* }
* },
* admin_permission = "administer display modes",
* config_prefix = "entity.view_mode",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -25,7 +25,7 @@
* controllers = {
* "storage" = "Drupal\field\FieldConfigStorageController"
* },
* config_prefix = "field.field",
* config_prefix = "field",
* entity_keys = {
* "id" = "id",
* "label" = "id",
......
......@@ -24,7 +24,7 @@
* controllers = {
* "storage" = "Drupal\field\FieldInstanceConfigStorageController"
* },
* config_prefix = "field.instance",
* config_prefix = "instance",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -29,7 +29,7 @@
* "list" = "Drupal\filter\FilterFormatListController",
* "access" = "Drupal\filter\FilterFormatAccessController",
* },
* config_prefix = "filter.format",
* config_prefix = "format",
* admin_permission = "administer filters",
* entity_keys = {
* "id" = "format",
......
......@@ -32,7 +32,7 @@
* "list" = "Drupal\image\ImageStyleListController",
* },
* admin_permission = "administer image styles",
* config_prefix = "image.style",
* config_prefix = "style",
* entity_keys = {
* "id" = "name",
* "label" = "label",
......
......@@ -28,7 +28,7 @@
* }
* },
* admin_permission = "administer languages",
* config_prefix = "language.entity",
* config_prefix = "entity",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -29,7 +29,6 @@
* "delete" = "Drupal\Core\Entity\EntityFormController"
* }
* },
* config_prefix = "migrate.migration",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -29,7 +29,7 @@
* "list" = "Drupal\node\NodeTypeListController",
* },
* admin_permission = "administer content types",
* config_prefix = "node.type",
* config_prefix = "type",
* bundle_of = "node",
* entity_keys = {
* "id" = "type",
......
......@@ -27,7 +27,7 @@
* },
* list_path = "admin/config/media/picturemapping",
* admin_permission = "administer pictures",
* config_prefix = "picture.mappings",
* config_prefix = "mappings",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -17,7 +17,7 @@
* @ConfigEntityType(
* id = "rdf_mapping",
* label = @Translation("RDF mapping"),
* config_prefix = "rdf.mapping",
* config_prefix = "mapping",
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid"
......
......@@ -39,7 +39,7 @@
* "disable" = "search.disable",
* "set-default" = "search.set_default"
* },
* config_prefix = "search.page",
* config_prefix = "page",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -30,7 +30,7 @@
* "delete" = "Drupal\shortcut\Form\ShortcutSetDeleteForm"
* }
* },
* config_prefix = "shortcut.set",
* config_prefix = "set",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -20,7 +20,6 @@
* id = "action",
* label = @Translation("Action"),
* admin_permission = "administer actions",
* config_prefix = "system.action",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -27,7 +27,6 @@
* "delete" = "Drupal\system\Form\DateFormatDeleteForm"
* }
* },
* config_prefix = "system.date_format",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -21,7 +21,6 @@
* controllers = {
* "access" = "Drupal\system\MenuAccessController"
* },
* config_prefix = "system.menu",
* admin_permission = "administer menu",
* entity_keys = {
* "id" = "id",
......
......@@ -27,7 +27,7 @@
* }
* },
* admin_permission = "administer taxonomy",
* config_prefix = "taxonomy.vocabulary",
* config_prefix = "vocabulary",
* bundle_of = "taxonomy_term",
* entity_keys = {
* "id" = "vid",
......
......@@ -20,7 +20,6 @@
* controllers = {
* "view_builder" = "Drupal\tour\TourViewBuilder"
* },
* config_prefix = "tour.tour",
* entity_keys = {
* "id" = "id",
* "label" = "label",
......
......@@ -28,7 +28,7 @@
* }
* },
* admin_permission = "administer permissions",
* config_prefix = "user.role",
* config_prefix = "role",
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
......
......@@ -26,7 +26,6 @@
* "access" = "Drupal\views\ViewAccessController"
* },
* admin_permission = "administer views",
* config_prefix = "views.view",
* entity_keys = {
* "id" = "id",
* "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