| Summary: | forceSingleItem doesn't work for extension commands with a run() method | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | Client | Assignee: | Mark Macdonald <mamacdon> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse, ken_walker, susan |
| Version: | 1.0 | Flags: | susan:
review+
ken_walker: review+ |
| Target Milestone: | 1.0 RC3 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Mark Macdonald
+1 for the fix, good catch.
Clearly the intention was to do this and it was sloppily coded.
Adding Ken for approval for RC3.
RAFAEL - This change will break your existing implementation of the Cloudfier "Deploy" command which was coding around this bug. You will need to change
var deploy = function(selection) {
return dojo.xhrPost({
postData: '',
handleAs: 'json',
url: "../mdd/deployer/?path=" + selection[0].Location
});
};
to
var deploy = function(selection) {
return dojo.xhrPost({
postData: '',
handleAs: 'json',
url: "../mdd/deployer/?path=" + selection.Location
});
};
Tested and verified Thanks for the heads-up! Honestly, the original behavior didn't strike me as a surprising behavior - I wouldn't expect the type of an argument to change depending on the the size of the selection. I assume this (parameter type varying) is consistent with other Orion API? For a Java-head like me, the new behavior is surprising, but we are not in Java-land anyways. (In reply to comment #5) > Thanks for the heads-up! Honestly, the original behavior didn't strike me as > a surprising behavior - I wouldn't expect the type of an argument to change > depending on the the size of the selection. I assume this (parameter type > varying) is consistent with other Orion API? For a Java-head like me, the > new behavior is surprising, but we are not in Java-land anyways. It's not so much that it changes depending on size of the selection, but that you were using "forceSingleItem" in your definition, which means your command is only ever enabled for a single item. That is what affects the selection parameter. If you weren't using that property, then your command would be enabled for multiple selection and you would get the array. Thanks, Susan, I understand that, I meant the size of the *intended* selection (single, multiple). But no biggie, just a data point. |