| @@ -389,9 +389,12 @@ | ||
| 389 | 389 | } |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | public function allSubmissions($attributes = []) { |
| 393 | - $searchExtender = function ($q, $escaped) { | |
| 393 | + // Match by form title only in the cross-form view; once a form is | |
| 394 | + // selected the search must hit submission data only, so the listing | |
| 395 | + // stays identical to the (form-scoped) export and single-form list. | |
| 396 | + $searchExtender = Arr::get($attributes, 'form_id') ? null : function ($q, $escaped) { | |
| 394 | 397 | $q->orWhereHas('form', function ($q) use ($escaped) { |
| 395 | 398 | $q->where('title', 'LIKE', "%{$escaped}%"); |
| 396 | 399 | }); |
| 397 | 400 | }; |