If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Local patch for addons.mozilla.org

VERIFIED FIXED

Status

Infrastructure & Operations
WebOps: Other
VERIFIED FIXED
9 years ago
4 years ago

People

(Reporter: clouserw, Unassigned)

Tracking

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
We had some problems with our new "let me install this" checkboxes.  Since it's preventing people from downloading add-ons and there isn't a clear explanation why I'm filing for a mid-cycle local patch.  Please apply this patch locally on production.
(Reporter)

Comment 1

9 years ago
Created attachment 372719 [details] [diff] [review]
fix download problems

Fixes bug 487745 and bug 488092
Attachment #372719 - Flags: review?(stephen.donner)
Attachment #372719 - Flags: review?(buchanae)
a=stephend/krupa; bug 487745 and bug 488092 have been heavily tested, and look good.
Attachment #372719 - Flags: review?(stephen.donner) → review+
Attachment #372719 - Flags: review?(buchanae) → review+
(Reporter)

Comment 3

9 years ago
I just remembered we compress/combine addons.js in production so this won't be a straight patch. :(
(Reporter)

Comment 4

9 years ago
Created attachment 372726 [details] [diff] [review]
patch with compressed changes

Alright, this patch is the same as the first but includes the compressed changes and the revision tweak.  Please only apply this patch.  Thanks.

Comment 5

9 years ago
patching file webroot/js/addons.js
patching file webroot/js/jquery.addons.min.js
patching file config/revisions.php
patching file views/addons/policy.thtml

Svn diff(addons.min exploded):

Index: webroot/js/addons.js
===================================================================
--- webroot/js/addons.js	(revision 24323)
+++ webroot/js/addons.js	(working copy)
@@ -883,16 +883,19 @@
     var bt = $(div).find('.install-button a');
 
     var href = $(bt).attr('href');
-    if (href && href.match(/.xpi/)) {
-	href += '?confirmed';
+    if (href && href.match(/(policy|\.xml|\.xpi|\.jar)/)) {
+        href += '?confirmed';
         $(bt).attr('href', href);
     }
 
     var tmp = $(bt).attr('save-onclick');
-    if (tmp) 
-	$(bt).attr('onclick', tmp);
-    else
-	$(bt).removeAttr('onclick');
+    if (tmp) {
+        if (tmp.match(/\.xml'\);$/))
+            tmp = tmp.replace(/\.xml'\);$/, ".xml?confirmed');");
+        $(bt).attr('onclick', tmp);
+    } else {
+        $(bt).removeAttr('onclick');
+    }
 }
 function unconfirmExpInstall(div) {
     $(div).removeClass('exp-confirmed');
Index: config/revisions.php
===================================================================
--- config/revisions.php	(revision 24323)
+++ config/revisions.php	(working copy)
@@ -1,5 +1,5 @@
 <?php
 define('REVISION', 24322);
 define('CSS_REVISION', 24317);
-define('JS_REVISION', 24322);
-?>
\ No newline at end of file
+define('JS_REVISION', 24413);
+?>
Index: controllers/addons_controller.php
===================================================================
--- controllers/addons_controller.php	(revision 24323)
+++ controllers/addons_controller.php	(working copy)
@@ -164,7 +164,8 @@
     */
     function display($id = null) {
         global $valid_status;
-        
+
+        $this->forceShadowDb();
         $this->Amo->clean($id);
 
         $this->publish('bigHeader', true);
@@ -502,7 +503,8 @@
      */
     function browse() {
         global $app_listedtypes, $hybrid_categories;
-        
+
+        $this->forceShadowDb();
         if (!isset($this->namedArgs['type'])) {
             // @TODO throw a 404 error
             $this->redirect('/');
Index: views/addons/policy.thtml
===================================================================
--- views/addons/policy.thtml	(revision 24323)
+++ views/addons/policy.thtml	(working copy)
@@ -101,6 +101,20 @@
   <?=$html->link(_('a_cancel_installation'), "/addon/{$addon['Addon']['id']}");?>
   <?php }?>
   </div>
+  <script type="text/javascript">
+    $( function() {
+          if (window.location.href.match(/\?confirmed$/)) {
+            var bt = $("div#content").find('.install-button a');
+            var href = $(bt).attr('href');
+              if (href)
+                  $(bt).attr('href', href + "?confirmed");
+
+            var onclick = $(bt).attr('onclick');
+              if (onclick && onclick.match(/\.xml'\);$/))
+                  $(bt).attr('onclick', onclick.replace(/\.xml'\);$/, ".xml?confirmed');"));
+          }
+       });
+  </script>
   <!-- /#content-policy -->
 
   <div class="vex"><span><!-- bottom edge --></span></div>
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Comment 6

9 years ago
Svn diff(addons.min exploded):

s/exploded/excluded/
I verified both bug 487745 and bug 488092 in production.

Verified FIXED.
Status: RESOLVED → VERIFIED
Component: Server Operations: Web Operations → WebOps: Other
Product: mozilla.org → Infrastructure & Operations
You need to log in before you can comment on or make changes to this bug.