Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291155

Bundle entity form IDs violate module namespaces (both on server-side + front-end CSS)

$
0
0

Follow up for #1871772-108: Convert custom blocks to content entities

Problem/Motivation

+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
@@ -0,0 +1,216 @@
+ // Override the default CSS class name, since the user-defined custom block
+ // type name in 'TYPE-block-form' potentially clashes with third-party class
+ // names.
+ $form['#attributes']['class'][0] = drupal_html_class('block-' . $block->type->value . '-form');
The BUNDLE_TYPE_form pattern is a massive anti-pattern from Node module in the first place.

Let's create a (major) follow-up issue to change that form ID pattern to prevent such namespace conflicts (for all entity types).

This is that discussion

Proposed resolution

Decide on a class naming pattern for entity forms and implement it

Remaining tasks

Write the patch


Viewing all articles
Browse latest Browse all 291155

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>