Skip to content
Snippets Groups Projects

Fix IEF-ID breaks, leading to hard to debug errors

1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
@@ -2,6 +2,7 @@
namespace Drupal\inline_entity_form\Plugin\Field\FieldWidget;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
@@ -168,6 +169,7 @@ abstract class InlineEntityFormBase extends WidgetBase implements ContainerFacto
protected function makeIefId(array $parents) {
$iefId = implode('-', $parents);
$iefId = preg_replace('#-inline_entity_form-entities-([0-9]+)-form-#', '-$1-', $iefId);
$iefId = Html::cleanCssIdentifier($iefId);
return $iefId;
}
Loading