mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(Code Node): Fix item and items alias regression (#6331)
This commit is contained in:
committed by
GitHub
parent
77e3f1551d
commit
54e3838dae
@@ -102,13 +102,18 @@ export class Code implements INodeType {
|
||||
const getSandbox = (index = 0) => {
|
||||
const code = this.getNodeParameter(codeParameterName, index) as string;
|
||||
const context = getSandboxContext.call(this, index);
|
||||
if (nodeMode === 'runOnceForAllItems') {
|
||||
context.items = context.$input.all();
|
||||
} else {
|
||||
context.item = context.$input.item;
|
||||
}
|
||||
|
||||
if (language === 'python') {
|
||||
const modules = this.getNodeParameter('modules', index) as string;
|
||||
const moduleImports: string[] = modules ? modules.split(',').map((m) => m.trim()) : [];
|
||||
context.printOverwrite = workflowMode === 'manual' ? this.sendMessageToUI : null;
|
||||
return new PythonSandbox(context, code, moduleImports, index, this.helpers);
|
||||
} else {
|
||||
context.items = context.$input.all();
|
||||
const sandbox = new JavaScriptSandbox(context, code, index, workflowMode, this.helpers);
|
||||
if (workflowMode === 'manual') {
|
||||
sandbox.vm.on('console.log', this.sendMessageToUI);
|
||||
|
||||
Reference in New Issue
Block a user