#1946404: Convert forms in field_ui.admin.inc to the new form interface removed 90% of the Field UI 'admin' section of hook_entity_bundle_info(), leaving only 'real path', which is used almost exclusively by Field UI confirmation forms and the "Field List" admin reports page.

At this point it can be automatically derived, no more need for module developers to specify it manually.

Files: 
CommentFileSizeAuthor
#10 field-admin-path-1982088-10.patch14.74 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 55,511 pass(es).
[ View ]
#10 interdiff.txt2.31 KBtim.plunkett
#5 real-path-1982088-5.patch14.8 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 55,389 pass(es).
[ View ]
#5 interdiff.txt2.17 KBtim.plunkett
#3 real-path-1982088-3.patch15.16 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#3 interdiff.txt4 KBtim.plunkett
#1 admin-path-1982088-1.patch13.05 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 55,260 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new13.05 KB
PASSED: [[SimpleTest]]: [MySQL] 55,260 pass(es).
[ View ]

This path actually has nothing to do with the Field UI, it's about the Entity itself.

Status:Needs review» Reviewed & tested by the community

Awesome! Also we need to unify uri() entity_uri mess

StatusFileSize
new4 KB
new15.16 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

Yeah, this has nothing to do with entities, just entity types.

When this was decoupled from entity_get_info(), there was no longer any need to access config files directly.
Also fixing user and hook.

Status:Reviewed & tested by the community» Needs work

The last submitted patch, real-path-1982088-3.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.17 KB
new14.8 KB
PASSED: [[SimpleTest]]: [MySQL] 55,389 pass(es).
[ View ]

I forgot about hook_field_extra_fields and its ilk. Reverting the entity_load_multiple bits.

+++ b/core/modules/block/custom_block/custom_block.moduleundefined
@@ -184,12 +184,7 @@ function custom_block_entity_bundle_info() {
   foreach (config_get_storage_names_with_prefix('custom_block.type.') as $config_name) {
+++ b/core/modules/contact/contact.moduleundefined
@@ -176,13 +176,7 @@ function contact_entity_bundle_info() {
   foreach (config_get_storage_names_with_prefix('contact.category.') as $config_name) {
+++ b/core/modules/node/node.moduleundefined
@@ -213,15 +213,10 @@ function node_entity_view_mode_info() {
   foreach (node_type_get_names() as $type => $name) {
+++ b/core/modules/taxonomy/taxonomy.moduleundefined
@@ -125,12 +125,7 @@ function taxonomy_entity_bundle_info() {
   foreach (taxonomy_vocabulary_get_names() as $id) {

a lot of inconsistency for follow-ups

awesome cleanup!

+++ b/core/lib/Drupal/Core/Entity/EntityManager.phpundefined
@@ -200,4 +200,31 @@ public function getAccessController($entity_type) {
+    if (isset($entity_info['route_base_path'])) {
+      // If the entity type has a bundle prefix, strip it out of the path.
+      if (isset($entity_info['bundle_prefix'])) {
+        $bundle = str_replace($entity_info['bundle_prefix'], '', $bundle);
+      }
+      // Replace any dynamic 'bundle' portion of the path with the actual bundle.
+      $admin_path = str_replace('{bundle}', $bundle, $entity_info['route_base_path']);

what happens here if there is no bundle_prefix, besides $bundle being undefined?

Status:Needs review» Reviewed & tested by the community

yea, apparently i missed the $bundle argument:)

Status:Reviewed & tested by the community» Needs work

This will need a re-roll for #1982984: Create Drupal::entityManager for improved DX.

Apart from that, this looks like a great clean-up to me.

Status:Needs work» Needs review
StatusFileSize
new2.31 KB
new14.74 KB
PASSED: [[SimpleTest]]: [MySQL] 55,511 pass(es).
[ View ]

Reroll!

Status:Needs review» Reviewed & tested by the community

looks good:)

Status:Reviewed & tested by the community» Fixed

Committed 50ae329 and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.