Closed Bug 420354 Opened 17 years ago Closed 17 years ago

History not shown in sidebar when sorted by date or by date and site

Categories

(Firefox :: Bookmarks & History, defect, P2)

defect

Tracking

()

VERIFIED FIXED
Firefox 3 beta5

People

(Reporter: cedric.corazza, Assigned: ondrej)

References

Details

Attachments

(1 file, 3 obsolete files)

On a clean profile : browsing to several sites : the list does appear in History menu, but when using Display > Sidebar > History : no sites are shown. Clicking on the Sort button (default is By Date radio button), then choosing By site, sites list appears.
Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9b4pre) Gecko/2008022904 Minefield/3.0b4pre
Flags: blocking-firefox3?
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P2
I'm not able to reproduce this on latest nightly. do you see the "Today" folder? If so, is the expected history contained in the contents of that folder?
Assignee: nobody → ondrej
Target Milestone: --- → Firefox 3
This still occurs on latest fr tinderbox build (Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9b4pre) Gecko/2008030304 Minefield/3.0b4pre) but not on en-US latest nightly, where the folder "Today" appears.
So, I guess I should requalify this bug to a fr l10n bug?
(In reply to comment #2)
> So, I guess I should requalify this bug to a fr l10n bug?
> 

sounds like it, yes. thanks for checking.
Assignee: ondrej → bugzilla.fr
Component: Places → fr / French
Product: Firefox → Mozilla Localizations
QA Contact: places → benoit.leseul
Target Milestone: Firefox 3 → ---
Version: Trunk → unspecified
Flags: blocking-firefox3+
I saw there was no line at the end of file l10n/fr/toolkit/chrome/places/places.properties.
I make a try with adding one.
Assignee: bugzilla.fr → cedric.corazza
I reproduce this bug on Windows XP (I don't know if it's the same on Mac).
I think I found what is wrong. In the l10n/fr/toolkit/chrome/places/places.properties file, the string finduri-AgeInDays-is-0=Aujourd'hui contains an apostrophe. When I removed it, the bug disappeared; when I tried to escape it with a backslash (\'), the bug came back. I even tried to surround the string with quotes, same bug.
I don't know how to fix this and I guess this is a l12y problem. Could someone help me here?
Changing the old summary "History not shown in sidebar with clean profile on first launch" to make it more accurate
Summary: History not shown in sidebar with clean profile on first launch → History not shown in sidebar when sorted by date or by date and site
I'm not sure it is relevant, but it seems that our string (finduri-AgeInDays-is-0) is passed unescaped to an SQL query here:
http://mxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsNavHistory.cpp#2993

Since "Aujourd'hui" contains a quote character ('), I think this would cause a parse error around the dayTitle field when executing the SQL query.
Assignee: cedric.corazza → nobody
Component: fr / French → Places
Flags: blocking-firefox3?
OS: Linux → All
Product: Mozilla Localizations → Firefox
QA Contact: benoit.leseul → places
Hardware: PC → All
Version: unspecified → Trunk
(In reply to comment #7)
> I'm not sure it is relevant, but it seems that our string
> (finduri-AgeInDays-is-0) is passed unescaped to an SQL query here:
> http://mxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsNavHistory.cpp#2993
> 
> Since "Aujourd'hui" contains a quote character ('), I think this would cause a
> parse error around the dayTitle field when executing the SQL query.
> 

OOPS. Thanks for analysis. I will fix it.
Assignee: nobody → ondrej
Why are we dynamically building a query string anyway?  The reason for the bind parameter api's exactly because of things like this...
Shawn, can you file a follow up on the issue from comment #9?

In the meantime, this goes to l10n::fr ...
Assignee: ondrej → bugzilla.fr
Component: Places → fr / French
Flags: blocking-firefox3?
Product: Firefox → Mozilla Localizations
QA Contact: places → benoit.leseul
Version: Trunk → unspecified
Flags: blocking-firefox3+
(In reply to comment #10)
> Shawn, can you file a follow up on the issue from comment #9?
> 
> In the meantime, this goes to l10n::fr ...
> 

I'm afraid it is really my problem in Places. Localizers cannot do anything better and it could be related to multiple languages. I will try to solve it with binding.
(In reply to comment #10)
> Shawn, can you file a follow up on the issue from comment #9?
Filed bug 421115
(In reply to comment #10)
> In the meantime, this goes to l10n::fr ...

This is a Places bug...
Assignee: bugzilla.fr → nobody
Component: fr / French → Places
Product: Mozilla Localizations → Firefox
QA Contact: benoit.leseul → places
Assignee: nobody → ondrej
Status: NEW → ASSIGNED
This patch refactors the way parameters are bound in history service. It replaces position based parameters with named parameters. This makes the code more robust and is much more readable. For instance SelectAsSite query:

-               "&beginTime='||?1||'&endTime='||?2, "
+               "&beginTime='||:begin_time||'&endTime='||:end_time, "

Previously it was not easy to find what does ?1 refer to, now it is obvious.

Thanks to this it is now possible to add additional named parameters in PlacesSQLQueryBuilder. So the day names can now be bound rather then injected to the SQL string. French and all other locals should work fine now.
Attachment #307736 - Flags: review?(dietrich)
Comment on attachment 307736 [details] [diff] [review]
Refactor and enhance parameter binding

I found one more candidate for binding.
Attachment #307736 - Attachment is obsolete: true
Attachment #307736 - Flags: review?(dietrich)
Changes since first patcy:
- binding added for (local) 
- fixed incorrect sql for uriIsPrefix (tested using parts of bug 384226)
Attachment #308400 - Flags: review?(dietrich)
Blocks: 421115
Target Milestone: --- → Firefox 3 beta5
Version: unspecified → Trunk
Comment on attachment 308400 [details] [diff] [review]
 Refactor and enhance parameter binding v2

nice win on readability and compactness in the parameter bindings, as well as removing the fragility of the parameter order requirement (albeit trading off for more complexity in the helpers).

can you please confirm that we have a test that exercises the multiple query functionality? if not, please add one. also, please add a test specific to the problem this bug addresses.

r=me otherwise.

>   nsresult ConstructQueryString(const nsCOMArray<nsNavHistoryQuery>& aQueries, 
>                                 nsNavHistoryQueryOptions *aOptions,
>                                 nsCString& queryString,
>-                                PRBool& aParamsPresent);
>+                                PRBool& aParamsPresent,
>+                                StringHash & aAddParams);

nit: remove space
Attachment #308400 - Flags: review?(dietrich) → review+
Attached patch for check-in (obsolete) — Splinter Review
I have modified places.properties locally to include single quote and saw that it failed without this patch. With patch applied it was shown correctly. I'm not sure if I can create a test that would address this bug. It is covered with test_history_sidebar.js and would be visible (the query would fail), if the tests were executed with fr-FR locale.

I would prefer if multiple queries and complex queries get tested with bug 384226. I can take that bug over, but it is not blocking.
Attachment #308400 - Attachment is obsolete: true
I have added a simple test for multiple queries - and it did not PASS. Current code does this:
  WHERE original AND additional1 OR additional2
What is interpreted as:
  WHERE (original AND additional1) OR additional2
It must be changed to:
  WHERE original AND (additional1 OR additional2)

It is actually another bug, but I hope we can fix it with this patch.
Attachment #310218 - Attachment is obsolete: true
Attachment #310516 - Flags: review?(dietrich)
Comment on attachment 310516 [details] [diff] [review]
Refactored parameter binding + multi query test + fix for it

the tests win yet again ;)

r=me.
Attachment #310516 - Flags: review?(dietrich) → review+
Checking in toolkit/components/places/src/nsNavHistory.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v  <--  nsNavHistory.cpp
new revision: 1.277; previous revision: 1.276
done
Checking in toolkit/components/places/src/nsNavHistory.h;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.h,v  <--  nsNavHistory.h
new revision: 1.150; previous revision: 1.149
done
RCS file: /cvsroot/mozilla/toolkit/components/places/tests/unit/test_multi_queries.js,v
done
Checking in toolkit/components/places/tests/unit/test_multi_queries.js;
/cvsroot/mozilla/toolkit/components/places/tests/unit/test_multi_queries.js,v  <--  test_multi_queries.js
initial revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
verified with: 
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5pre)
Gecko/2008032106 Minefield/3.0b5pre
and
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9b5pre)
Gecko/2008032104 Minefield/3.0b5pre
Status: RESOLVED → VERIFIED
In member function ‘PRUint32 IndexGetter::For(const char*)’:
http://mxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsNavHistory.cpp#4837
warning: negative integer implicitly converted to unsigned type
In member function ‘nsresult nsNavHistory::ConstructQueryString(const nsCOMArray<nsNavHistoryQuery>&, nsNavHistoryQueryOptions*, nsCString&, PRBool&, nsDataHashtable<nsCStringHashKey, nsCString>&)’:
http://mxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsNavHistory.cpp#3298
warning: unused variable ‘clauseParameters’
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
I should have filed a new bug instead of reopening, sorry for that. See bug 424577.
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: