Closed Bug 348737 Opened 18 years ago Closed 18 years ago

restoring defaults in "manage search engines..." results in unordered list

Categories

(Firefox :: Search, defect, P1)

2.0 Branch
defect

Tracking

()

VERIFIED FIXED
Firefox 2

People

(Reporter: cbeard, Assigned: Gavin)

References

Details

(Keywords: verified1.8.1)

Attachments

(1 file)

If you use the "Manage Search Engines..." UI to delete a search engine and then click on "Restore Defaults" it places the deleted search engine at the top of the list. Whereas, it should restore the default set of search engines in the same order as shipped.

Steps to reproduce:
1. Note that search engines are ordered Google, Yahoo!, Amazon.com, Creative Commons, eBay in the drop down.
2. Open the "Manage Search Engines..." UI and delete "Creative Commons".
3. Click on "Restore Defaults".
4. Note that the search engines are now ordered Creative Commons, Google, Yahoo!, Amazon.com, eBay.
Flags: blocking-firefox2?
Severity: critical → major
OS: Mac OS X 10.3 → All
Hardware: PC → All
Known problem. The restored engines are in order with respect to each other, however.
Severity: major → normal
(In reply to comment #1)
> Known problem. The restored engines are in order with respect to each other,
> however.

Is there a bug filed on this already? I disagree that this behaviour is acceptable . It is confusing to the end-user and does not "restore" you to a known good state. It also does not meet the product requirement. We should correct this, and it should block release.
Flags: blocking-firefox2? → blocking-firefox2+
Won't block beta2, should be fixed by final. Can we use the fact that we have the order in which these searchplugins are first created to help here?
Target Milestone: Firefox 2 beta2 → Firefox 2
(In reply to comment #2)
> (In reply to comment #1)
> > Known problem. The restored engines are in order with respect to each other,
> > however.
> 
> Is there a bug filed on this already?
Nope.

> I disagree that this behaviour is
> acceptable .
I never said it was. I was merely saying that there is some ordering done, so it is possible to restore the default order if you just delete everything.

(In reply to comment #3)
> Won't block beta2, should be fixed by final. Can we use the fact that we have
> the order in which these searchplugins are first created to help here?
> 
We already have the ordering info - we merely have to use it. I had some issues trying to get that to work in bug 343707, so that was taken out in order to get some sort of restore defaults functionality landed in the engine manager for beta 2. The safe mode functionality also needs the same change.
Depends on: 334486, 343707
Michael: can the "restore" function do a second pass through the list once it's restored the defaults, and produce the correct engineMoveOps to restore the original engine order (defaults at the top)? Obviously not the most efficient algorithm (potentially resulting in a lot of redundant moveOps), but if it works...
Welcome back Gavin!
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Priority: -- → P1
Attached patch patchSplinter Review
This patch:
-Fixes getDefaultEngines to use getLocalizedPref. Calling getLocalizedPref in a loop isn't optimal, because it re-gets the prefservice on each call, but since that loop won't occur very often and isn't perf-critical, I favored readability
-Fixes both moveEngine functions to do nothing if the engine doesn't actually need to move (to ensure that "restoring" one engine in an already sorted list won't move and fire notifications for all engines in that list)
-Makes restoreDefaultEngines move already present default engines to their original positions when restoring
Attachment #235578 - Flags: review?(mconnor)
Whiteboard: [patch-r?]
Comment on attachment 235578 [details] [diff] [review]
patch

ok.

Is there a reason we don't cache the prefbranch in this impl?  its not that much work, and it helps perf a great deal
Attachment #235578 - Flags: review?(mconnor) → review+
(In reply to comment #8)
> Is there a reason we don't cache the prefbranch in this impl?  its not that
> much work, and it helps perf a great deal

Cache it where, in a global? I'd rather not hold on to it for the life of the app. This could certainly be optimized otherwise, but I don't think it's really worth the trouble for the trivial gain.
Whiteboard: [patch-r?]
mozilla/browser/components/search/content/engineManager.js 	1.12
mozilla/browser/components/search/nsSearchService.js 	1.75
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [needs approval]
Whiteboard: [needs approval] → [baking until 8/29][needs approval]
Attachment #235578 - Flags: approval1.8.1?
Comment on attachment 235578 [details] [diff] [review]
patch

a=schrep/beltnzer for drivers.
Attachment #235578 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [baking until 8/29][needs approval]
mozilla/browser/components/search/nsSearchService.js 	1.1.2.63
mozilla/browser/components/search/content/engineManager.js 	1.1.2.14
Keywords: fixed1.8.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060827 Minefield/3.0a1 ID:2006082718 [cairo]

search-box missing, manage search engines no response.
the checkin cause this ?
(In reply to comment #14)
> search-box missing, manage search engines no response.
> the checkin cause this ?

Nope, see bug 350424.
Verified FIXED using Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060828 BonEcho/2.0b2.

Deleted engines are now restored to their original order.

(If we're going to consider reordering engines making things non-default, shouldn't we activate the "Restore Defaults..." button if someone reorders an engine?)
Status: RESOLVED → VERIFIED
Awesome! Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: