From 41deabf99882aeb34d0c52da77e53a8332ac0f13 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Wed, 7 Jul 2021 09:33:48 +0300 Subject: [PATCH] hand legacy image_source field --- app/Http/Controllers/Api/AssetsController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index d3e881038f..dac9ac4d50 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -548,6 +548,14 @@ class AssetsController extends Controller ($request->filled('rtd_location_id')) ? $asset->location_id = $request->get('rtd_location_id') : null; + /** + * this is here just legacy reasons. Api\AssetController + * used image_source once to allow encoded image uploads. + */ + if ($request->has('image_source')) { + $request->offsetSet('image', $request->offsetGet('image_source')); + } + $asset = $request->handleImages($asset); // Update custom fields