mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
Fix vfs customfield for single file did not replace when you chose a different file from VFS
This commit is contained in:
parent
23fb0dcdd8
commit
1612ddb030
@ -963,10 +963,11 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
|
||||
const value = typeof e.target.value == "string" ? [e.target.value] : e.target.value;
|
||||
value.forEach(v =>
|
||||
{
|
||||
const info = e.target._dialog.fileInfo(v);
|
||||
const info = {...e.target._dialog.fileInfo(v)};
|
||||
if(!e.target.multiple)
|
||||
{
|
||||
info.name = field.name;
|
||||
info.path = "/apps/" + e.target.methodId.replaceAll(":", "/");
|
||||
}
|
||||
e.target.getParent().getWidgetById(attrs.id)?._addFile(info);
|
||||
});
|
||||
|
@ -648,7 +648,7 @@ export class et2_vfsUpload extends et2_file
|
||||
for(var child_index = this._children.length-1; child_index >= 0; child_index--)
|
||||
{
|
||||
var child = this._children[child_index];
|
||||
if(child.options.value.path === file_data.path)
|
||||
if(!child.options.value || child.options.value.path === file_data.path)
|
||||
{
|
||||
this.removeChild(child);
|
||||
child.destroy();
|
||||
|
@ -316,7 +316,11 @@ class Link extends Etemplate\Widget
|
||||
{
|
||||
if(!str_ends_with($dest_file, '/') && count($files) == 1)
|
||||
{
|
||||
// 1 file to a specific filename
|
||||
// 1 file to a specific filename, overwrite if already there
|
||||
if(file_exists(Api\Link::vfs_path($app, $id)))
|
||||
{
|
||||
unlink(Api\Link::vfs_path($app, $id));
|
||||
}
|
||||
Api\Vfs::symlink($files[0], Api\Link::vfs_path($app, $id));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user