Theme dropdowns allow selecting of item with no content

RESOLVED WONTFIX

Status

--
minor
RESOLVED WONTFIX
5 years ago
3 months ago

People

(Reporter: Mic, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
*** Original post on bio 463 at 2010-08-02 08:31:00 UTC ***

Using the keyboard and a collapsed drop down menu it is possible to select an item in the Message Style and Emoticon Theme boxes that has no label/value.
Occurs only if no additional themes are installed, so most likely the "no themes installed" item.

Effects: doesn't break display of preview if only cylced though, breaks style if saved.

Error console gives following error when saving the "empty style" and opening the Options dialog again: 
"Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIIOService.newChannel]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///<Instantbird path>/modules/imThemes.jsm :: getInfoPlistContent :: line 187"  data: no]
Source File: file:///<Instantbird path>/modules/imThemes.jsm
Line: 201"
(Reporter)

Comment 1

5 years ago
*** Original post on bio 463 at 2010-08-02 12:34:33 UTC ***

There's a bug on this in the Mozilla bugtracker: https://bugzilla.mozilla.org/show_bug.cgi?id=302060.

Still we should think about a solution, e.g. checking if the choice is valid before saving the "theme" preference.
See Also: → bug 302060
(Reporter)

Comment 2

5 years ago
Created attachment 8352077 [details] [diff] [review]
Patch v1

*** Original post on bio 463 as attmnt 336 at 2010-08-24 19:27:00 UTC ***

This patch saves the old selected theme names of messagestyle and emoticon themes and will restore them if an empty value is detected "on select".
Attachment #8352077 - Flags: review?(florian)
(Reporter)

Updated

5 years ago
Assignee: nobody → benediktp
(Reporter)

Comment 3

5 years ago
*** Original post on bio 463 at 2010-08-24 21:09:04 UTC ***

Some comments on the code:

// Here we store the name of the latest valid selected theme
previousThemeValue: "",

currentThemeChanged: function() {
  if (!this._loaded)
    return;

  // Element with id="themename" is the menulist
  let themeName = document.getElementById("themename");

  let currentTheme = themeName.value;

  // If there's no current value, then we have hit the disabled item ('no other themes installed' or the separator if that is possible at all)
  if (!currentTheme) {
    // Set back to previous value, will fire new 'select'-event and stop here
    themeName.value = this.previousThemeValue;
    return;
  }

  // Update preview only if the theme has changed, this prevents flickering if 
  //  someone keeps the up- or down-key pressed. (Due to the nature of the fix, 
  //  it won't jump from start to end of the list, but stop at top and at bottom)
  if(this.previousThemeValue != themeName.value)
    this.displayTheme(currentTheme);
  
  // Everything is fine now, the current theme is valid, set it as new fallback
  this.previousThemeValue = themeName.value;
},
*** Original post on bio 463 at 2010-09-13 17:04:37 UTC ***

Can you still reproduce this on a nightly using Mozilla2?
(Reporter)

Comment 5

5 years ago
*** Original post on bio 463 at 2010-09-13 17:43:18 UTC ***

Yes.

Updated

5 years ago
Status: NEW → ASSIGNED
OS: Windows XP → All
Hardware: x86 → All
Comment on attachment 8352077 [details] [diff] [review]
Patch v1

*** Original change on bio 463 attmnt 336 at 2010-12-16 09:35:20 UTC ***

I haven't really looked at this patch, but I have a feeling we should try to understand and fix the Mozilla real bug first, before deciding we want to clutter our code with a workaround.
Mic agreed over IRC.
Attachment #8352077 - Flags: review?(florian) → review-
(Reporter)

Updated

5 years ago
Status: ASSIGNED → NEW
(Reporter)

Comment 7

3 years ago
Mass-removing myself from being assignee of any Chat related bug as I'm no longer active.
Assignee: benediktp → nobody
On the behalf of Florian:
Closing bugs related to the Instantbird UI as WONTFIX, as the development of the standalone chat client Instantbird has stopped. Instantbird users are encouraged to migrate to Thunderbird. The user interface of instant messaging in Thunderbird will feel familiar, as the Thunderbird IM support started as a fork of Instantbird.
Status: NEW → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.