diff --git a/src/Backend/Modules/ModuleMaker/Layout/Templates/Backend/Actions/Snippets/MultipleImagesSaveEdit.base.php b/src/Backend/Modules/ModuleMaker/Layout/Templates/Backend/Actions/Snippets/MultipleImagesSaveEdit.base.php index 882feef55..12d2e3024 100644 --- a/src/Backend/Modules/ModuleMaker/Layout/Templates/Backend/Actions/Snippets/MultipleImagesSaveEdit.base.php +++ b/src/Backend/Modules/ModuleMaker/Layout/Templates/Backend/Actions/Snippets/MultipleImagesSaveEdit.base.php @@ -49,11 +49,18 @@ true ); - $photoId = Backend{$camel_case_name}Model::insertImage( + $sequence = 0; + foreach ($images as $image) { + if ($image->uploadName == $sImage['uploadName']) { + $sequence = $image->sequence; + } + } + + Backend{$camel_case_name}Model::insertImage( array( '{$underscored_name}_id' => $item['id'], 'name' => $sImage['uploadName'], - 'sequence' => $sImage['Index'] + 'sequence' => $sequence, ) ); }