#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 5 months ago by rjollos
comment:2 Changed 5 months ago by anonymous
- Component changed from SELECT A HACK to SimpleMultiProjectPlugin
- Owner set to crossroad
comment:3 Changed 5 months ago by falkb
- Owner changed from crossroad to falkb
- Status changed from new to assigned
comment:4 Changed 5 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 5 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 5 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 5 months ago by falkb
Please, apply testwise:
-
simplemultiprojectplugin/trunk/simplemultiproject/htdocs/filter_milestones.js
12 12 select.empty(); 13 13 14 14 var addedOptions = []; 15 if ( newOptions) {15 if (options && newOptions) { 16 16 $.each(newOptions, function(val, text) { 17 17 var isSelected = (selectedOption && text == selectedOption); 18 18 options[options.length] = new Option(text, text, isSelected, isSelected); … … 20 20 }); 21 21 } 22 22 23 if ( selectedOption && $.inArray(selectedOption, addedOptions) == -1) {23 if (options && selectedOption && $.inArray(selectedOption, addedOptions) == -1) { 24 24 options[options.length] = new Option(selectedOption, selectedOption, true, true); 25 25 }
Better now?
comment:8 follow-up: ↓ 9 Changed 5 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 5 months ago by falkb
comment:10 Changed 5 months ago by anonymous
- Resolution set to fixed
- Status changed from assigned to closed
working
comment:11 Changed 5 months ago by falkb
Thanks a lot. Most work of software programming goes to the handling of special cases.


Which plugin is this report for?