Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-31266

Search still relies on $.each instead of AJS.$ for jQuery access

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 5.3.1
    • 5.2
    • None
    • any clean Confluence 5.2.3 with disabled workbox plugin

    Description

      Relating to CONF-30251 and still open CONF-30243

      please see <INSTANCE>/wiki/download/contextbatch/js/confluence-search/batch.js

      try {
      /* module-key = 'com.atlassian.confluence.plugins.search.confluence-search:confluence-search-resources', location = '/js/utils.js' */
      Confluence.Search.Util={getFormParams:function(a){var b={};$.each(
      // ...
      

      will lead to errors like:

      [13:06:16.250] TypeError: $ is undefined @ <INSTANCE>/<...>/_/download/contextbatch/js/confluence-search/batch.js:206
      

      or

      [13:44:00.834] TypeError: $ is undefined @ <INSTANCE>/<...>/_/download/contextbatch/js/dashboard,atl.general/batch.js:13814
      

      caused by

      try {
      /* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = 'js/quicknav/quicknav.js' */
      var RYQ=RYQ|| /* ... */ {var a;if($.trim(b)
      

      will come up if workbox is disabled / exposition of $ is "fixed"

      So neither quick search nor updating search term will work!

      Error seen for Confluence 5.2.3

      Workaround: expose $ manually if workbox is disabled

      <!-- HOTFIXING https://jira.atlassian.com/browse/CONF-30251 -->
      <script type="text/javascript">
        if (!$) $=AJS.$;
      </script>
      

      Please atlassian, clean up your code and use AJS.$ as claimed to plugin developers.
      Thank you!

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              c34ad611bdfc childnode
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: