A free open source IT asset/license management system
Fixed updating notes in bulk edit
snipea1e6f01fe99f
diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.phpindex 27f6044d03..55fbe82cc9 100644--- a/app/Http/Controllers/Assets/BulkAssetsController.php+++ b/app/Http/Controllers/Assets/BulkAssetsController.php@@ -240,10 +240,6 @@ class BulkAssetsController extends Controller$custom_fields_to_null[str_replace('null', '', $key)] = $value;}----if (! $request->filled('ids') || count($request->input('ids')) == 0) {return redirect($bulk_back_url)->with('error', trans('admin/hardware/message.update.no_assets_selected'));@@ -274,6 +270,7 @@ class BulkAssetsController extends Controller|| ($request->filled('company_id'))|| ($request->filled('status_id'))|| ($request->filled('model_id'))+ || ($request->filled('notes'))|| ($request->filled('next_audit_date'))|| ($request->filled('asset_eol_date'))|| ($request->filled('null_name'))diff --git a/tests/Feature/Assets/Ui/BulkEditAssetsTest.php b/tests/Feature/Assets/Ui/BulkEditAssetsTest.phpindex 04880d4f3c..efedca4ca6 100644--- a/tests/Feature/Assets/Ui/BulkEditAssetsTest.php+++ b/tests/Feature/Assets/Ui/BulkEditAssetsTest.php@@ -88,7 +88,8 @@ class BulkEditAssetsTest extends TestCase'order_number' => '123456','warranty_months' => 24,'next_audit_date' => '2024-06-01',- 'requestable' => false+ 'requestable' => false,+ 'notes' => 'This is a new note!',]);// gets the ids together to submit to the endpoint@@ -108,7 +109,8 @@ class BulkEditAssetsTest extends TestCase'order_number' => '7890','warranty_months' => 36,'next_audit_date' => '2025-01-01',- 'requestable' => true+ 'requestable' => true,+ 'notes' => 'This is a newer note!',])->assertStatus(302)->assertSessionHasNoErrors();@@ -128,6 +130,7 @@ class BulkEditAssetsTest extends TestCase$this->assertEquals('2025-01-01', $asset->next_audit_date);// shouldn't requestable be cast as a boolean??? it's not.$this->assertEquals(1, $asset->requestable);+ $this->assertEquals('This is a newer note!', $asset->notes);});}@@ -156,7 +159,8 @@ class BulkEditAssetsTest extends TestCase'order_number' => '123456','warranty_months' => 24,'next_audit_date' => '2024-06-01',- 'requestable' => false+ 'requestable' => false,+ 'notes' => 'This is a note that will be deleted',]);// gets the ids together to submit to the endpoint@@ -169,6 +173,7 @@ class BulkEditAssetsTest extends TestCase'null_purchase_date' => '1','null_expected_checkin_date' => '1','null_next_audit_date' => '1',+ 'null_notes' => '1','status_id' => $status2->id,'model_id' => $model2->id,])@@ -181,6 +186,7 @@ class BulkEditAssetsTest extends TestCase$this->assertNull($asset->purchase_date);$this->assertNull($asset->expected_checkin);$this->assertNull($asset->next_audit_date);+ $this->assertNull($asset->notes);});}