]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1355490 - Short URL link give "The token is not valid" error
authorDylan William Hardison <dylan@hardison.net>
Wed, 3 May 2017 11:38:59 +0000 (07:38 -0400)
committerDylan William Hardison <dylan@hardison.net>
Wed, 3 May 2017 11:39:18 +0000 (07:39 -0400)
js/global.js
template/en/default/global/header.html.tmpl

index 04bc3fedf92290ca835fc2fcfb7bf5e7c6a997bd..7d89473dac4dd30cd070cc34a72a1eab437a6629 100644 (file)
@@ -16,7 +16,7 @@
 *                 
 */
 
-var BUGZILLA = $('head').data('bugzilla');
+var BUGZILLA = $("#bugzilla-global").data("bugzilla");
 
 $(function () {
   $('body').addClass("platform-" + navigator.platform);
index 215afefd03647dccbd8bb0a8e83f55e5fa8dbb8c..5cd0fef7940c531a159820ae78b415a4192bc35b 100644 (file)
   # value of title anyway.  To get around that problem we explicitly
   # set header's default value here only if it is undefined. %]
 [% IF !header.defined %][% header = title %][% END %]
-[%- js_BUGZILLA = {
-        param => {
-            cookiepath => Param('cookiepath'),
-            maxusermatches => Param('maxusermatches'),
-        },
-        constant => {
-            COMMENT_COLS => constants.COMMENT_COLS,
-        },
-        string => {
-            # Please keep these in alphabetical order.
-
-            attach_desc_required =>
-                'You must enter a Description for this attachment.',
-            component_required => 
-                "You must select a Component for this $terms.bug",
-            description_required => 
-                "You must enter a Description for this $terms.bug",
-            short_desc_required =>
-                "You must enter a Summary for this $terms.bug",
-            version_required =>
-                "You must select a Version for this $terms.bug"
-        }
-    };
-    IF generate_api_token;
-        js_BUGZILLA.api_token = get_api_token();
-    END; 
-%]
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                       "http://www.w3.org/TR/html4/loose.dtd">
 <html lang="en">
-  <head data-bugzilla='[% json_encode(js_BUGZILLA) FILTER html %]'>
+  <head>
+    [%- js_BUGZILLA = {
+            param => {
+                cookiepath => Param('cookiepath'),
+                maxusermatches => Param('maxusermatches'),
+            },
+            constant => {
+                COMMENT_COLS => constants.COMMENT_COLS,
+            },
+            string => {
+                # Please keep these in alphabetical order.
+                attach_desc_required =>
+                    'You must enter a Description for this attachment.',
+                component_required =>
+                    "You must select a Component for this $terms.bug",
+                description_required =>
+                    "You must enter a Description for this $terms.bug",
+                short_desc_required =>
+                    "You must enter a Summary for this $terms.bug",
+                version_required =>
+                    "You must select a Version for this $terms.bug"
+            }
+        };
+    %]
     [% Hook.process("start") %]
+    [%
+       IF generate_api_token;
+        js_BUGZILLA.api_token = get_api_token();
+       END;
+    %]
+
+    <meta name="bugzilla-global" content="dummy"
+        id="bugzilla-global" data-bugzilla="[% json_encode(js_BUGZILLA) FILTER html %]">
     <title>[% title %]</title>
 
     [% IF Param('utf8') %]