Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tk277 opened this issue Aug 2, 2024 · 2 comments
Open

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

tk277 opened this issue Aug 2, 2024 · 2 comments

Comments

@tk277
Copy link

tk277 commented Aug 2, 2024

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
Copy link
Owner

Fixed in 3.4.31. Can you retry?

@tk277
Copy link
Author

tk277 commented Sep 3, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants