Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10784 closed defect (fixed)

Don't work if no milestone defined

Reported by: gdoumenc@… Owned by: falkb
Priority: normal Component: SimpleMultiProjectPlugin
Severity: blocker Keywords:
Cc: Trac Release:

Description

If there is no milestone defined.. (perhaps bad idea but..) filter_milestone.js crashes as no options found...

Attachments (0)

Change History (11)

comment:1 Changed 12 years ago by Ryan J Ollos

Which plugin is this report for?

comment:2 Changed 12 years ago by anonymous

Component: SELECT A HACKSimpleMultiProjectPlugin
Owner: changed from anonymous to Christopher Paredes

comment:3 Changed 12 years ago by falkb

Owner: changed from Christopher Paredes to falkb
Status: newassigned

comment:4 Changed 12 years ago by falkb

Please, provide the circumstances of the crash:

  • Versions of Trac, Python, used internet browser and svn version of SimpleMultiProjectPlugin
  • exact javascript error text (seen in browser debugger?)

comment:5 in reply to:  description Changed 12 years ago by falkb

Replying to gdoumenc@coworks.pro:

If there is no milestone defined.. (perhaps bad idea but..) filter_milestone.js crashes as no options found...

Do you have no milestone in the whole Trac instance, or just for a certain project?

comment:6 Changed 12 years ago by anonymous

No milestone in the whole instance..

In code for milestone (select), there is no options and options is null!!

...
    if (select.prop) {
        options = select.prop('options');
    }
    else {
        options = select.attr('options');
    }
...

comment:7 Changed 12 years ago by falkb

Please, apply testwise:

  • simplemultiprojectplugin/trunk/simplemultiproject/htdocs/filter_milestones.js

     
    1212    select.empty();
    1313
    1414    var addedOptions = [];
    15     if (newOptions) {
     15    if (options && newOptions) {
    1616        $.each(newOptions, function(val, text) {
    1717            var isSelected = (selectedOption && text == selectedOption);
    1818            options[options.length] = new Option(text, text, isSelected, isSelected);
     
    2020        });
    2121    }
    2222
    23     if (selectedOption && $.inArray(selectedOption, addedOptions) == -1) {
     23    if (options && selectedOption && $.inArray(selectedOption, addedOptions) == -1) {
    2424        options[options.length] = new Option(selectedOption, selectedOption, true, true);
    2525    }

Better now?

comment:8 Changed 12 years ago by anonymous

Sorry, I used egg to install so I don't know where to do the change.. ;(

comment:9 in reply to:  8 Changed 12 years ago by falkb

Replying to anonymous:

Sorry, I used egg to install so I don't know where to do the change.. ;(

Now I've committed [12547] to SVN which may help. Please, reinstall the new egg, and report back.

comment:10 Changed 12 years ago by anonymous

Resolution: fixed
Status: assignedclosed

working

comment:11 Changed 12 years ago by falkb

Thanks a lot. Most work of software programming goes to the handling of special cases.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain falkb.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.