Closed Bug 575255 Opened 14 years ago Closed 14 years ago

[ACR Extension] ACR makes preferences menu enabled for every add-on even if they don't have preferences

Categories

(addons.mozilla.org Graveyard :: Compatibility Tools, defect)

ACR-0.*
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
ACR-0.*

People

(Reporter: whimboo, Assigned: kinger)

References

()

Details

(Whiteboard: [acr-0.6])

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a6pre) Gecko/20100625 Minefield/3.7a6pre

If an add-on doesn't provide preferences the Preferences menu item has to be disabled. As example you can take ACR (see the link above). Otherwise users will get the impression that the preferences can't be opened. The state of the buttons is correct.
This appears to be a bug with the ACR as it works fine without it installed.
blocking2.0: ? → ---
Component: Add-ons Manager → Compatibility Tools
Product: Toolkit → addons.mozilla.org
QA Contact: add-ons.manager → compatibility
Summary: Preferences menuitem in add-ons context menu is not disabled if no preferences are available → [ACR Extension] ACR makes preferences menu enabled for every add-on even if they don't have preferences
Version: Trunk → ACR-0.*
The problem we hit here is that we wrongly parse the install.rdf. The ACR extension has a multi-line comment and that one is not recognized by our parser:

<!-- <em:optionsURL>chrome://acr/content/ui/options.xul</em:optionsURL>
<em:iconURL>chrome://acr/skin/images/star32.png</em:iconURL> -->

I'm able to reproduce it with any add-on and it was working in Firefox 3.6.
blocking2.0: --- → ?
Component: Compatibility Tools → Add-ons Manager
Product: addons.mozilla.org → Toolkit
QA Contact: compatibility → add-ons.manager
Summary: [ACR Extension] ACR makes preferences menu enabled for every add-on even if they don't have preferences → Multi-line comments in install.rdf wrongly parsed which causes e.g. preferences dialog to be used even it is commented out
Version: ACR-0.* → Trunk
(In reply to comment #2)
> The problem we hit here is that we wrongly parse the install.rdf. The ACR
> extension has a multi-line comment and that one is not recognized by our
> parser:
> 
> <!-- <em:optionsURL>chrome://acr/content/ui/options.xul</em:optionsURL>
> <em:iconURL>chrome://acr/skin/images/star32.png</em:iconURL> -->

I don't see any signs that we are failing to parse this install.rdf correctly. All of the data goes into the database as expected and it would be very unlikely that bad data in the install.rdf for a single add-on would affect every other add-on like this. To verify I removed the entire comment block and reinstalled it and still with ACR enabled every single add-on in the list shows an enabled Preferences menu, with it disabled only the add-ons with settings windows shows Preferences enabled.

> I'm able to reproduce it with any add-on and it was working in Firefox 3.6.

What are you able to reproduce exactly?
Sorry, you are right. All extensions I had installed had a preference dialog. So I wasn't seeing that all add-ons get the preference context menu item enabled. Now with the DOM inspector installed too, I can also see it.

Moving over again to the ACR extension.
blocking2.0: ? → ---
Component: Add-ons Manager → Compatibility Tools
Product: Toolkit → addons.mozilla.org
QA Contact: add-ons.manager → compatibility
Summary: Multi-line comments in install.rdf wrongly parsed which causes e.g. preferences dialog to be used even it is commented out → [ACR Extension] ACR makes preferences menu enabled for every add-on even if they don't have preferences
Version: Trunk → unspecified
(In reply to comment #3)
> > I'm able to reproduce it with any add-on and it was working in Firefox 3.6.
> 
> What are you able to reproduce exactly?

With Firefox 3.6 the DOM inspector doesn't have the preference menu item enabled. So it looks like a bad interaction between ACR and the new API.
Whiteboard: [AddonsRewrite]
-> for a 0.5.1 release.
Assignee: nobody → briks.si
Target Milestone: --- → ACR-0.*
Version: unspecified → ACR-0.*
Problem code is the overriding of gViewController.updateCommands in extensionsOverlayController.js:

        ACR.Controller.ExtensionsOverlay._updateCommandsStack = gViewController.updateCommands;
        gViewController.updateCommands = function()
        {
            ACR.Controller.ExtensionsOverlay._updateCommandsStack();
            ACR.Controller.ExtensionsOverlay._invalidateCompatibilityButtons();
        }

The original commands are not being updated ... investigating more...
Status: NEW → ASSIGNED
Fixed, r72373. Instead of overriding updateCommands, I switched to adding an event listener for "ViewChanged". Seems to be just what we need.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Was this fixed for a specific version of ACR?
(In reply to comment #11)
> Was this fixed for a specific version of ACR?

Watch for 0.6, which should be released very soon.
Looks good with 0.6. Marking as verified fixed.
Status: RESOLVED → VERIFIED
Whiteboard: [acr-0.6]
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.