Skip to content
Snippets Groups Projects
Commit 5b7d89c2 authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3422462 by vasike: Use a simplified form ID if the form ID is too...

Issue #3422462 by vasike: Use a simplified form ID if the form ID is too specific - ends with Entities IDs
parent 3b46958b
No related branches found
No related tags found
No related merge requests found
Pipeline #257355 passed with warnings
......@@ -131,6 +131,13 @@ class Dazzler implements RenderCallbackInterface {
$form_id_suggestion = str_replace('views_exposed_form__', 'views__', $form['#theme'][0]);
}
// Use a simplified form ID if the form ID is too specific and it has
// a number at the end of ID string.
// @see \Drupal\commerce_cart\Form\AddToCartForm::getFormId()
elseif (str_starts_with($form_id_suggestion, $last_suggestion) && preg_match('/([a-zA-Z]_)*\d$/', $form_id_suggestion) === 1) {
$form_id_suggestion = $last_suggestion;
}
return $form_id_suggestion;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment