file upload from bank working
This commit is contained in:
parent
53ca51c154
commit
4f808ba017
5 changed files with 34 additions and 11 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
Description: test
|
Description:
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
Tags: bouton poussoir
|
Tags:
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
|
|
@ -0,0 +1,17 @@
|
||||||
|
Description: test
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Tags: DA globale
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Sort: 7
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Uuid: cWXe3yDs2zcLLiQE
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
Template: image
|
||||||
|
|
@ -14,7 +14,7 @@ Description:
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
Clientbriefimages:
|
Clientbriefimages: - file://cWXe3yDs2zcLLiQE
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,12 @@ return [
|
||||||
$source = page('materials')->file($imageData['uuid']);
|
$source = page('materials')->file($imageData['uuid']);
|
||||||
try {
|
try {
|
||||||
$copiedFile = $source->copy($page);
|
$copiedFile = $source->copy($page);
|
||||||
$updatedFile = $source->update([
|
$updatedFile = $copiedFile->update([
|
||||||
'description' => $imageData['description'],
|
'description' => $imageData['description'],
|
||||||
'tags' => $imageData['tags'],
|
'tags' => $imageData['tags'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$allFiles[] = (string) $updatedFile->uuid();
|
$allFiles[] = (string) $copiedFile->uuid();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$alerts[$source->name()] = $e->getMessage();
|
$alerts[$source->name()] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
@ -98,14 +98,20 @@ return [
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if (!empty($allFiles)) {
|
||||||
|
// Empty page update needed to updates its files data
|
||||||
|
$newPage = $page->update([]);
|
||||||
|
|
||||||
|
$newPage = $page->update([
|
||||||
$page = $page->update([
|
|
||||||
'clientBriefImages' => $allFiles
|
'clientBriefImages' => $allFiles
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Exception(json_encode($allFiles), 1);
|
||||||
|
|
||||||
|
|
||||||
$images = [];
|
$images = [];
|
||||||
// foreach ($page->clientBriefImages()->toFiles() as $image) {
|
// foreach ($newPage->clientBriefImages()->toFiles() as $image) {
|
||||||
// $images[] = [
|
// $images[] = [
|
||||||
// 'url' => $image->url(),
|
// 'url' => $image->url(),
|
||||||
// 'uuid' => (string) $image->uuid(),
|
// 'uuid' => (string) $image->uuid(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue