In some circumstances clicking apply button in dnd widget the editor gives a ajax submit is not a function and outputs the results as json.

@afox debugged and finally solved this by adding dependencies to jquery.form and drupal.ajax

Comments

wroxbox’s picture

StatusFileSize
new558 bytes

and here is the patch.

--author="afox <afox@125378.no-reply.drupal.org>"
jcisio’s picture

Status: Needs review » Active
StatusFileSize
new518 bytes

I can't reproduce this. However with this patch, I check and in fact there was a bug with commit in #1903628: Incompatibility with jQuery update module (it would be really difficult to debug, a big thanks!).

Could you test the attached patch?

jcisio’s picture

Status: Active » Fixed

While I can't reproduce the bug, the patch #2 is "obviously" correct, so I tested again and committed it. I gave credit to @afox because without the original patch, it would take me hours if I were to debug. Thanks.

afox’s picture

Thanks @jcsio,
FYI, I traced the bug to core's ajax.inc, line 681:

  // Attach JavaScript settings to the element.
  if (isset($element['#ajax']['event'])) {
    $element['#attached']['library'][] = array('system', 'jquery.form');
    $element['#attached']['library'][] = array('system', 'drupal.ajax');

This is in ajax_pre_render_element() which, I believe, processes ajax enabled elements in the form. So, if there's no ajaxified fields, the libraries are never added.

Status: Fixed » Closed (fixed)

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