From 53a4130722961f1a1f55898d357738e5d5b1b102 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 4 Apr 2018 17:54:30 +0200 Subject: [PATCH] Fix move/copy actions in link_to widget vfsSelect try to create not unwanted new symlink --- api/src/Etemplate/Widget/Link.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/api/src/Etemplate/Widget/Link.php b/api/src/Etemplate/Widget/Link.php index cf0bdf3ce6..097081177f 100644 --- a/api/src/Etemplate/Widget/Link.php +++ b/api/src/Etemplate/Widget/Link.php @@ -243,7 +243,7 @@ class Link extends Etemplate\Widget $response = Api\Json\Response::get(); $response->data($result !== false); } - + /** * Symlink/copy/move an existing file in filemanager * @@ -273,14 +273,16 @@ class Link extends Etemplate\Widget { Api\Vfs::copy_files($files, Api\Link::vfs_path($app, $id, '', true)); } - if ($action == "move") + elseif ($action == "move") { Api\Vfs::move_files($files, Api\Link::vfs_path($app, $id, '', true), $errs = array(), $moved = array()); } - - foreach($files as $target) + else { - Api\Link::link_file($app, $id, $target); + foreach($files as $target) + { + Api\Link::link_file($app, $id, $target); + } } }