Daniel-KM / Omeka-S-module-AdvancedSearch

Module for Omeka S that improves search with new fields, auto-suggest, filters, facets, specific pages, etc.
Other
3 stars 2 forks source link

Block „Search form (module Advanced Search)” doesn’t work #13

Open tk277 opened 1 month ago

tk277 commented 1 month ago

I found three problems with the site block:

1) Within a search you don't stay on the page where you inserted the block In my opinion, the problem is here: AdvancedSearch/view/search/search.phtml, line 70 $isPartial = $skipFormAction = !empty($skipFormAction); The value is accessed incorrectly: $isPartial = $skipFormAction = !empty($this->skip_form_action);

2) You don't get any search results AdvancedSearch/view/common/block-layout/searching-form.phtml, line 22 Here you also need to pass the parameters $query and $response:

<?= $searchConfig->renderForm([
    'template' => $displayResults ? 'search/search' :  null,
    'skip_form_action' => $skipFormAction,
    'query' => $query,
    'response' => $response,
]) ?>

3) Searching and faceting are not executed AdvancedSearch/src/Site/BlockLayout/SearchingForm.php, line 139 I think, the wrong array is filtered here, so no search parameters are existing: $request = array_filter($query, fn ($v) => $v !== '' && $v !== [] && $v !== null); You need to filter $request $request = array_filter($request, fn ($v) => $v !== '' && $v !== [] && $v !== null);

Without these changes, the block element did not work for me. I used version 3.4.26 with Omeka S 4.1.1. If you have any questions, just get in touch! Thank you!

Daniel-KM commented 2 weeks ago

Fixed in 3.4.31. Can you retry?

tk277 commented 1 week ago

Thank you very much!

I still have the problem that when I submit a search within the page block, I don't stay on the page, but I am redirected to the related search page that I specified in the block under "search page configs".

As long as I do not specify a query or hidden filter query in the page block, no search results are displayed on the page on which the block is integrated. As soon as I specify a hidden query, the corresponding results are displayed. Is this behavior planned? Otherwise you could also specify the hidden filter query directly in the page config in the search manager, for example.

I still use Omeka S 4.1.1. Just let me know if you have any questions!