- Issue created by @trickfun
I want to open a modal form into a standard form. I setup a link to open the modal.
$form['actions']['suspend'] = [
'#type' => 'link',
'#title' => t('Save Cart'),
'#url' => Url::fromRoute('oto_commerce_cart_suspended.suspended_form'),
'#attributes' => [
'class' => [
'use-ajax',
'button',
'btn btn-primary'
],
],
'#weight' => 100
];
// Attach the library for pop-up dialogs/modals.
$form['#attached']['library'][] = 'core/drupal.dialog.ajax';
When i try my code into gin theme i don't have problem. code works fine.
When i try to use into frontend theme i get this error:
Uncaught TypeError: settings.dialog is undefined
attach https://localhost/core/misc/dialog/dialog.ajax.js?v=9.5.10:21
attachBehaviors https://localhost/core/misc/drupal.js?v=9.5.10:24
attachBehaviors https://localhost/core/misc/drupal.js?v=9.5.10:21
<anonymous> https://localhost/core/misc/drupal.init.js?v=9.5.10:24
listener https://localhost/core/misc/drupal.init.js?v=9.5.10:14
domReady https://localhost/core/misc/drupal.init.js?v=9.5.10:20
<anonymous> https://localhost/core/misc/drupal.init.js?v=9.5.10:23
<anonymous> https://localhost/core/misc/drupal.init.js?v=9.5.10:26
what is missing?
Thank you
Active
9.5