Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: process all input items in GDrive list - N8N-3784 #3525

Merged
merged 10 commits into from
Jul 10, 2022
17 changes: 12 additions & 5 deletions packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class GoogleDrive implements INodeType {
name: 'googleDrive',
icon: 'file:googleDrive.svg',
group: ['input'],
version: 1,
version: [1, 2],
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Access data on Google Drive',
defaults: {
Expand Down Expand Up @@ -475,7 +475,7 @@ export class GoogleDrive implements INodeType {
minValue: 1,
maxValue: 1000,
},
default: 100,
default: 50,
description: 'Max number of results to return',
},
{
Expand Down Expand Up @@ -951,7 +951,7 @@ export class GoogleDrive implements INodeType {
type: 'multiOptions',
options: [
{
name: '*',
name: '[All]',
value: '*',
description: 'All fields',
},
Expand Down Expand Up @@ -1404,7 +1404,7 @@ export class GoogleDrive implements INodeType {
},
options: [
{
name: '*',
name: '[All]',
value: '*',
description: 'All spaces',
},
Expand Down Expand Up @@ -2268,6 +2268,7 @@ export class GoogleDrive implements INodeType {
// Create a shallow copy of the binary data so that the old
// data references which do not get changed still stay behind
// but the incoming data does not get changed.
// @ts-ignore
Object.assign(newItem.binary, items[i].binary);
}

Expand Down Expand Up @@ -2365,7 +2366,13 @@ export class GoogleDrive implements INodeType {

const files = response!.files;

return [this.helpers.returnJsonArray(files as IDataObject[])];
const version = this.getNode().typeVersion;

if (version === 1) {
return [this.helpers.returnJsonArray(files as IDataObject[])];
} else {
returnData.push(...files);
}

} else if (operation === 'upload') {
// ----------------------------------
Expand Down