Skip to content

Commit

Permalink
Fix: #5054 - do not require dummy search value for new advanced-searc…
Browse files Browse the repository at this point in the history
…h fields
  • Loading branch information
fisharebest committed Nov 15, 2024
1 parent 94582e9 commit 707e8a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/Http/RequestHandlers/SearchAdvancedAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$fields = Validator::parsedBody($request)->array('fields');
$modifiers = Validator::parsedBody($request)->array('modifiers');
$other_field = Validator::parsedBody($request)->string('other_field');
$other_value = Validator::parsedBody($request)->string('other_value');

if ($other_field !== '' && $other_value !== '') {
$fields[$other_field] = $other_value;
if ($other_field !== '') {
$fields[$other_field] = '';
}

return redirect(route(SearchAdvancedPage::class, [
Expand Down
6 changes: 1 addition & 5 deletions resources/views/search-advanced-page.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@ use Illuminate\Support\Collection;
<?= I18N::translate('Add more fields') ?>
</div>

<div class="col-sm-3 wt-page-options-value">
<div class="col-sm-6 wt-page-options-value">
<?= view('components/select', ['name' => 'other_field', 'selected' => '', 'options' => ['' => ''] + $other_fields]) ?>
</div>

<div class="col-sm-3 wt-page-options-value">
<input type="text" class="form-control" name="other_value">
</div>

<div class="col-sm-3 wt-page-options-value">
</div>
</div>
Expand Down

0 comments on commit 707e8a4

Please sign in to comment.