Custom column added by extension is not displayed properly while in "grouped by sort"

RESOLVED FIXED in mozilla1.9.1

Status

MailNews Core
Backend
--
minor
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: Gil, Assigned: rkent)

Tracking

Trunk
mozilla1.9.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Build Identifier: 2 beta 2 (20070116)

A custom column added by extension is is not handled properly in "grouped by sort" mode. Apparently CreateDBView is not called, so the extension is not notified about view change (bug 359357) 

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Reporter)

Comment 1

11 years ago
Should be assigned to David Bienvenu

Comment 2

11 years ago
taking - no promises, though. I don't know how hard this will be. It definitely won't be in 2.0, I'm afraid.
Assignee: mscott → bienvenu
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 3

10 years ago
Custom columns also do not work in cross folder virtual folders mode.
(Assignee)

Comment 4

10 years ago
(In reply to comment #3)
> Custom columns also do not work in cross folder virtual folders mode.
> 

Sorry, my comment not valid. Following examples (including my own!), I was accessing data in the custom column extension as:

getCellText:         function(row, col) {
      var key = gDBView.getKeyAt(row);
      var hdr = gDBView.db.GetMsgHdrForKey(key);
      return hdr.getStringProperty("junkscore");

To make this work with all types of folders, change the next to last line to:

      var hdr = gDBView.getFolderForViewIndex(row).GetMessageHeader(key);

Still doesn't work for group sort, which was the original point of this bug.
(Assignee)

Comment 5

10 years ago
This is a pretty simple fix. I'll do a patch for it.
Assignee: bienvenu → kent
(Assignee)

Comment 6

10 years ago
Created attachment 329105 [details] [diff] [review]
Added observer call in threadpane.js

I just needed to add the observer call in threadpane.js. One little quirk is that I needed a viewtype, which the observer service sends, though as far as I know nobody is really using. Anyway, the switch to grouped sort claims to be nsMsgViewType.eShowAllThreads. This perpetuates the existing bug that grouped by sort does not work in single-folder virtual folders, but instead returns the entire folder.
Attachment #329105 - Flags: superreview?(bienvenu)
Attachment #329105 - Flags: review?(bienvenu)

Comment 7

10 years ago
Comment on attachment 329105 [details] [diff] [review]
Added observer call in threadpane.js

looks right, except there's no need for the local var viewType, or observerService - it can all be one statement (on several lines :-))
Attachment #329105 - Flags: superreview?(bienvenu)
Attachment #329105 - Flags: superreview+
Attachment #329105 - Flags: review?(bienvenu)
Attachment #329105 - Flags: review+
(Assignee)

Comment 8

10 years ago
This does not just affect TB or Windows.
Severity: normal → minor
Status: NEW → ASSIGNED
Component: Mail Window Front End → MailNews: Backend
OS: Windows XP → All
Product: Thunderbird → Core
Hardware: PC → All
Target Milestone: --- → mozilla1.9.1
Version: unspecified → Trunk
(Assignee)

Comment 9

10 years ago
Created attachment 329110 [details] [diff] [review]
Eliminated unneeded local variables

Here's the revisision without local variables. Have to wait until the tree opens to checkin-needed though.
Attachment #329105 - Attachment is obsolete: true
QA Contact: front-end → backend
(Assignee)

Updated

10 years ago
Keywords: checkin-needed
Checking in mailnews/base/resources/content/threadPane.js;
/cvsroot/mozilla/mailnews/base/resources/content/threadPane.js,v  <--  threadPane.js
new revision: 1.98; previous revision: 1.97
done
Keywords: checkin-needed
(Assignee)

Updated

10 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.