Problem/Motivation
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
Comments
Comment #3
quietone commented@trickfun, as you can see by the lack of responses here the Drupal Core issue queue is not the ideal place for support requests. The 'support request' option is there for filing support issues for contributed modules and themes. There are several support options listed on our Support page. This is 'Get Support' at the top of Drupal.org. There is also information about Drupal Slack , at 'Get Support -> Drupal Slack' also at the top of Drupal.org. You may get better replies in one of those places.
Cheers