mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Fix storing subflow credential type when input has multiple types
Fixes #3749
This commit is contained in:
		| @@ -931,6 +931,7 @@ RED.subflow = (function() { | ||||
|  | ||||
|  | ||||
|     function buildEnvUIRow(row, tenv, ui, node) { | ||||
|         console.log(tenv, ui) | ||||
|         ui.label = ui.label||{}; | ||||
|         if ((tenv.type === "cred" || (tenv.parent && tenv.parent.type === "cred")) && !ui.type) { | ||||
|             ui.type = "cred"; | ||||
| @@ -991,6 +992,17 @@ RED.subflow = (function() { | ||||
|                         default: inputType | ||||
|                     }) | ||||
|                     input.typedInput('value',val.value) | ||||
|                     if (inputType === 'cred') { | ||||
|                         if (node.credentials) { | ||||
|                             if (node.credentials[tenv.name]) { | ||||
|                                 input.typedInput('value', node.credentials[tenv.name]); | ||||
|                             } else if (node.credentials['has_'+tenv.name]) { | ||||
|                                 input.typedInput('value', "__PWRD__") | ||||
|                             } else { | ||||
|                                 input.typedInput('value', ""); | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
|                 } else { | ||||
|                     input.val(val.value) | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user