When using Linkit with modules such as Media (https://www.drupal.org/project/media) and Dialog (https://www.drupal.org/project/dialog), and enabling JavaScript aggregation in the Drupal Performance settings, ajax does not load properly. This causes issues such as:

* Views with ajax enabled are broken
* Rich text editor fails loading
* Administrative menus never load
* Linkit modal window never finishes fully rendering (jQuery UI doesn't run causing modal window to be disabled)

The problem is the use of this dependency code when loading the Linkit base library:

    'dependencies' => array(
      array('system', 'ui.dialog'),
      array('system', 'drupal.ajax'),
    ),

... combined with the fact that modules such as Dialog need to replace the default Drupal ajax.js file with their own version. When aggregation is enabled, Linkit expects the standard misc/ajax.js to exist, but it has already been replaced.

The way to avoid this is to set explicit dependencies on the Linkit dashboard and autocomplete JavaScript files, to ensure they always load. This eliminates the errors, and allows Linkit, Media, Dialog, and general JavaScript loading to play nicely together.

Please review the attached patch. I'm open to approaching this another way if someone feels there is a better solution. Thanks.

CommentFileSizeAuthor
linkit-modules_replace_drupal_ajax-1.patch874 bytesron_s
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ron_s created an issue. See original summary.

anon’s picture

Status: Needs review » Fixed

Thanks for patch.

  • anon committed 5fe7128 on 7.x-3.x authored by ron_s
    Issue #3020435 by ron_s, anon: Conflict with modules that replace Drupal...
mr.york’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.