Modify

Opened 20 months ago

Closed 19 months ago

Last modified 19 months 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 20 months ago by rjollos

Which plugin is this report for?

comment:2 Changed 20 months ago by anonymous

  • Component changed from SELECT A HACK to SimpleMultiProjectPlugin
  • Owner set to crossroad

comment:3 Changed 19 months ago by falkb

  • Owner changed from crossroad to falkb
  • Status changed from new to assigned

comment:4 Changed 19 months 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 19 months 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 19 months 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 19 months 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 follow-up: Changed 19 months 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 19 months 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 19 months ago by anonymous

  • Resolution set to fixed
  • Status changed from assigned to closed

working

comment:11 Changed 19 months ago by falkb

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

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.