CRM-10670 Drupal jQuery conflict

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.4.0
    • Labels:
      None

      Description

      When installing Drupal and the CiviCRM module and also installing Drupal's jquery_update module with the latest version of jQuery, jQuery breaks with an error message on the registration page of Drupal. This might also happen under other conditions. The fix I provide seems to me like it would work for other conditions as well but I haven't tested it in Joomla or without the jquery_update module.

        Attachments

        1. jquery-conflict-fix_new.patch
          1 kB
          Tim-Hinnerk Heuer
        2. jquery-conflict-fix.patch
          1 kB
          Tim-Hinnerk Heuer
        3. jquery-conflict-fix.patch
          0.9 kB
          Tim-Hinnerk Heuer

          Activity

          [CRM-10670] Drupal jQuery conflict
          Kurund Jalmi added a comment -

          If I understand correctly your patch uses drupal's jquery else appends CiviCRM's jquery version. We don't want to do this since drupal and civicrm's version of jquery might be different.

          Tim-Hinnerk Heuer added a comment -

          How about this patch then? It assumes almost nothing and works in my setup and I assume also with Joomla or others.

          Kurund Jalmi added a comment -

          The reason for including separate jquery is to avoid version conflicts with drupal. Most of the tiimes CiviCRM might be on latest release of jquery, where as drupal core might be bit behind. Hence we can't rely on drupal's jquery, so above patch might possible break some functionality in CiviCRM.

          Tim-Hinnerk Heuer added a comment -

          Have you read the patch? It assumes nothing and should work also with "normal" installations. The approach is that it loads both versions of jQuery, assigns the first one to djQuery (Drupal's jQuery) and then loads the second one with jQuery.noConflict(true) and then assigns that version (civi's) to cj like before, but now loads back the "old" version after civi's js files. I haven't tested it but without this patch it is broken for me at least and I believe also for others.

          I have attached the same patch with a different file name (jquery-conflict-fix_new.patch). Please read before you deny its validity.

          Kurund Jalmi added a comment -

          New patch seems good, however one concern is for Drupal, we don't use jquery.tpl. It uses jquery.files.tpl. Check civicrm.module file, basically we fetch the files and use drupal_add_js method to add all the js files. So not sure how this fix solves your problem. Let us know.

          Kurund Jalmi added a comment -

          there has been significant changes related to this in 4.3 which might have solved this.

            People

            • Assignee:
              Kurund Jalmi
              Reporter:
              Tim-Hinnerk Heuer

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified