Open Bug 1113692 Opened 5 years ago Updated 5 months ago

A search engine that was set as default removed and then restored is used at searches from url bar

Categories

(Firefox :: Search, defect, P4)

defect
Points:
5

Tracking

()

People

(Reporter: petruta.rasa, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: [ui][fxsearch])

Reproduced using Firefox 35 beta 5, Developer Edition 36.0a2 2014-12-18 and latest Nightly 37.0a1 2014-12-19 under all platforms.

Steps to reproduce:
1. Open Preferences/Search
2. Remove the search engine that is set as default (eg Yahoo) - the first search engine on the list becomes default (eg Google)
3. Select "Restore Default Search Engines" - the search engine previously removed is brought back to the list, the default search engine is not changed (Google in this case)
4. Perform searches from url bar, about:home, about:newtab, search toolbar

Expected results:
All searches should be performed with the default search engine.

Actual results:
On about:home, about:newtab and search toolbar, the searches are made with the engine automatically selected at step 2. On url bar the searches are performed with the search engine from step 1. 
(Google appears as default, in url bar Yahoo results are opened.)
Is this a regression?

In my opinion "the default search engine is not changed" in step 3 is also kind of a bug.
(In reply to Florian Quèze [:florian] [:flo] from comment #1)
> Is this a regression?
Thanks for asking. I was thinking about it, but forgot in the meantime.
I was able to reproduce it on Firefox 4.0.1, so it's not a regression. Probably there's a dupe somewhere, couldn't find it yet.

> In my opinion "the default search engine is not changed" in step 3 is also kind of a bug.
Yes, it could be.
No longer depends on: 1106559
(In reply to Florian Quèze [:florian] [:flo] from comment #1)
> In my opinion "the default search engine is not changed" in step 3 is also
> kind of a bug.

I agree, I filed bug 1119872.
Flags: qe-verify+
Flags: firefox-backlog+
The short-term solution here is to ensure that we're using one of Services.search.defaultEngine/currentEngine consistently throughout Firefox. I'm not sure which we should pick, probably just whichever requires fewer changes.
Points: --- → 5
Priority: -- → P4
Whiteboard: [fxsearch][searchui]
Rank: 45
Whiteboard: [fxsearch][searchui] → [ui][fxsearch]
Semi-random guess is that the code at http://mxr.mozilla.org/mozilla-central/source/docshell/base/nsDefaultURIFixup.cpp?rev=91d4539e00ce#495 would use GetCurrentEngine rather than GetDefaultEngine.
(In reply to :Gavin Sharp [email: gavin@gavinsharp.com] from comment #4)
> The short-term solution here is to ensure that we're using one of
> Services.search.defaultEngine/currentEngine consistently throughout Firefox.
> I'm not sure which we should pick, probably just whichever requires fewer
> changes.

In bug 1237648, I'm changing defaultEngine to become just an alias of currentEngine.

While working there, I noticed that existing tests were actually enforcing one behavior difference between the 2 attributes: when the original default engine is removed (ie. hidden), defaultEngine fallbacks to the next visible engine until the original default is unhidden, whereas the currentEngine attribute won't switch back automatically (intentional behavior implemented in bug 1227045).

So I think the bug reported here can be explained by this behavior difference + the nsDefaultURIFixup code using defaultEngine (comment 5) + the browser/ code sync'ing the two attributes failing to catch a change due to bug 1165341.
Depends on: 1575649
You need to log in before you can comment on or make changes to this bug.