diff --git a/app/Http/Controllers/Api/SuppliersController.php b/app/Http/Controllers/Api/SuppliersController.php index 672858a5a8..288b6b3c2d 100644 --- a/app/Http/Controllers/Api/SuppliersController.php +++ b/app/Http/Controllers/Api/SuppliersController.php @@ -155,7 +155,7 @@ class SuppliersController extends Controller ]); if ($request->has('search')) { - $suppliers = $suppliers->where('locations.name', 'LIKE', '%'.$request->get('search').'%'); + $suppliers = $suppliers->where('suppliers.name', 'LIKE', '%'.$request->get('search').'%'); } $suppliers = $suppliers->orderBy('name', 'ASC')->paginate(50); diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 1d1296c4cf..4223ea02cf 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -888,12 +888,30 @@ class SettingsController extends Controller public function postBackups() { + if (!config('app.lock_passwords')) { Artisan::call('backup:run'); - return redirect()->route('settings.backups.index')->with('success', trans('admin/settings/message.backup.generated')); - } else { - return redirect()->to("settings.backups.index")->with('error', trans('general.feature_disabled')); - } + $output = Artisan::output(); + + // Backup completed + if (!preg_match('/failed/', $output)) { + return redirect()->route('settings.backups.index') + ->with('success', trans('admin/settings/message.backup.generated')); + } + + + $formatted_output = str_replace('Backup completed!', '', $output); + $output_split = explode('...', $formatted_output); + + if (array_key_exists(2, $output_split)) { + return redirect()->route("settings.backups.index")->with('error', $output_split[2]); + } + return redirect()->route("settings.backups.index")->with('error', $formatted_output); + + } + return redirect()->route("settings.backups.index")->with('error', trans('general.feature_disabled')); + + } diff --git a/resources/views/importer/import.blade.php b/resources/views/importer/import.blade.php index ce64f6fda2..b32372833e 100644 --- a/resources/views/importer/import.blade.php +++ b/resources/views/importer/import.blade.php @@ -29,12 +29,16 @@