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

trickfun created an issue. See original summary.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Closed (outdated)

@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