Ticket #10784 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

Don't work if no milestone defined

Reported by: gdoumenc@coworks.pro Assigned to: 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

Change History

01/10/13 17:06:44 changed by rjollos

Which plugin is this report for?

01/10/13 17:07:33 changed by anonymous

  • owner set to crossroad.
  • component changed from SELECT A HACK to SimpleMultiProjectPlugin.

01/18/13 21:46:57 changed by falkb

  • status changed from new to assigned.
  • owner changed from crossroad to falkb.

01/18/13 21:50:04 changed 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?)

(in reply to: ↑ description ) 01/22/13 14:55:52 changed 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?

01/22/13 15:04:03 changed 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');
    }
...

01/22/13 15:20:13 changed by falkb

Please, apply testwise:

Index: simplemultiprojectplugin/trunk/simplemultiproject/htdocs/filter_milestones.js
===================================================================
--- simplemultiprojectplugin/trunk/simplemultiproject/htdocs/filter_milestones.js	(revision 12546)
+++ simplemultiprojectplugin/trunk/simplemultiproject/htdocs/filter_milestones.js	(working copy)
@@ -12,7 +12,7 @@
     select.empty();
 
     var addedOptions = [];
-    if (newOptions) {
+    if (options && newOptions) {
         $.each(newOptions, function(val, text) {
             var isSelected = (selectedOption && text == selectedOption);
             options[options.length] = new Option(text, text, isSelected, isSelected);
@@ -20,7 +20,7 @@
         });
     }
 
-    if (selectedOption && $.inArray(selectedOption, addedOptions) == -1) {
+    if (options && selectedOption && $.inArray(selectedOption, addedOptions) == -1) {
         options[options.length] = new Option(selectedOption, selectedOption, true, true);
     }

Better now?

(follow-up: ↓ 9 ) 01/22/13 15:40:42 changed by anonymous

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

(in reply to: ↑ 8 ) 01/22/13 15:46:13 changed 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.

01/22/13 16:12:00 changed by anonymous

  • status changed from assigned to closed.
  • resolution set to fixed.

working

01/22/13 16:15:50 changed by falkb

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


Add/Change #10784 (Don't work if no milestone defined)




Change Properties
Action