From 6c5ac352775db39146438dfb521d19db52b3b990 Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Fri, 25 May 2018 16:08:58 +0200 Subject: [PATCH] Fix bug: Creating an archive fails if only one element is selected --- build/libifm.php | 3 +++ ifm.php | 3 +++ src/ifm.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/build/libifm.php b/build/libifm.php index 511f829..76a6b60 100644 --- a/build/libifm.php +++ b/build/libifm.php @@ -2607,6 +2607,9 @@ function IFM( params ) { var id = self.generateGuid(); self.task_add( { id: id, name: self.i18n.create_archive+" "+archivename } ); + if( ! Array.isArray( items ) ) + items = [items]; + $.ajax({ url: self.api, type: "POST", diff --git a/ifm.php b/ifm.php index 4b93cbf..b5bda4a 100644 --- a/ifm.php +++ b/ifm.php @@ -2607,6 +2607,9 @@ function IFM( params ) { var id = self.generateGuid(); self.task_add( { id: id, name: self.i18n.create_archive+" "+archivename } ); + if( ! Array.isArray( items ) ) + items = [items]; + $.ajax({ url: self.api, type: "POST", diff --git a/src/ifm.js b/src/ifm.js index f11cc1d..dcc589e 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -1166,6 +1166,9 @@ function IFM( params ) { var id = self.generateGuid(); self.task_add( { id: id, name: self.i18n.create_archive+" "+archivename } ); + if( ! Array.isArray( items ) ) + items = [items]; + $.ajax({ url: self.api, type: "POST",