A free open source IT asset/license management system
Add custom_fields. prefix so custom fields can be filtered against
Marcus Moore4a7b7183d2d2
diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.phpindex 22a2ba88fc..1a7e80e313 100644--- a/app/Http/Controllers/Api/AssetsController.php+++ b/app/Http/Controllers/Api/AssetsController.php@@ -119,7 +119,9 @@ class AssetsController extends Controller$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page loadforeach ($all_custom_fields as $field) {- $allowed_columns[] = $field->db_column_name();+ // custom fields are prefixed with "custom_fields.".+ // We'll add them to the allowed columns so they can be searched.+ $allowed_columns[] = 'custom_fields.' . $field->db_column_name();}$filter = [];