Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-329

Including a different jQuery version library causes an error when inserting a comment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Later
    • Resolution: Fixed
    • Affects Version/s: 5.3.0
    • Fix Version/s: 5.4.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      steps to reproduce

      1. load the attached zul
      2. insert a comment with the context menu

      current result

      TypeError: jq(...).cleditor is not a function
      zssex.Richtextbox<._init()
      zssex.wpd:19
      zssex.Richtextbox<.bind_/<()
      zssex.wpd:19
      zssex.wpd:19:118

      Because js file loading order might be different from time to time, this issue sometimes doesn't happen. You need to reload the page several times to reproduce it.

      expected result

      no error

      root cause

      • the jQuery object passed to CLEditor plugin might be another version of jQuery instead of zk bundled jQuery depending on js file loading order. So the function cleditor() might not be availiable on jq

      solution

      always pass jq to CLEditor plugin to avoid being overridden by another jQuery library. In the last line of jqery.cleditor.js, replace jQuery with jq. Plese refer to attached jqery.cleditor.js

      (function ($) {
      
          //==============
          // jQuery Plugin
          //==============
      
          $.cleditor = {
              //...
          }
      
      })(jq);
      

      workaround

      call noConflict(). Please refer to jq-noConflict.js

        Attachments

        1. jquery.cleditor.js
          43 kB
        2. jq-noConflict.js
          0.0 kB
        3. 1302.zul
          0.4 kB

          Issue Links

            Activity

              People

              Assignee:
              wenninghsu wenninghsu
              Reporter:
              hawk hawk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: