I found the solution.
The issue was the No title block. Since all my templates have title blocks I just removed the lines from my code and now it works with Roberts edits
_handlePrintInfo: function(data) {
var Layout_Template = array.filter(data.parameters, function(param) {
return param.name === "Layout_Template";
});
if (Layout_Template.length === 0) {
console.log("print service parameters name for templates must be \"Layout_Template\"");
return;
}
var layoutParam;
var layoutItems = array.map(Layout_Template[0].choiceList, lang.hitch(this, function(item) {
layoutParam = this.layoutParams[item];
if(item !== "MAP_ONLY" && item !== "Elevation8x11Portrait" && item !== "Elevation8x11Landscape" && item !== "PreApp_8.5x11Portrait" && item !== "UtilityLocates8x11Portrait" && item !== "UtilityLocates8x11Landscape" && item !== "PreApp_8.5x11Landscape"){
return {
label: item,
value: item
};
}
}));
var keys = functional.keys(this.layoutParams);
var bIndex;
layoutItems.sort(function(a, b) {
bIndex = array.indexOf(keys, b.value);
return (bIndex !== -1) ? array.indexOf(keys, a.value) - bIndex : -1;
});
this.layoutDijit.addOption(layoutItems);
this.mapSheetParams.layout = this.defaultLayout ? this.defaultLayout : Layout_Template[0].defaultValue;
this.layoutDijit.set('value', this.mapSheetParams.layout);
this.onStateChange('LAYOUT', this.mapSheetParams.layout);
var Format = array.filter(data.parameters, function(param) {
return param.name === "Format";
});
if (Format.length === 0) {
console.log("print service parameters name for format must be \"Format\"");
return;
}
var formatItems = array.map(Format[0].choiceList, function(item) {
return {
label: item,
value: item
};
});
formatItems.sort(function(a, b) {
return (a.label > b.label) ? 1 : ((b.label > a.label) ? -1 : 0);
});
this.formatDijit.addOption(formatItems);
if (this.defaultFormat) {
this.formatDijit.set('value', this.defaultFormat);
} else {
this.formatDijit.set('value', Format[0].defaultValue);
}
},