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

[BUGFIX] Fix SearchInDocument middleware #1248

Merged
merged 5 commits into from
Jul 9, 2024

Conversation

beatrycze-volk
Copy link
Collaborator

It reverses the change made in #1088.

SearchInDocument Middleware can not use getQueryParams() function because it gets parameters from the POST request.

   /**
     * Retrieve any parameters provided in the request body.
     *
     * If the request Content-Type is either application/x-www-form-urlencoded
     * or multipart/form-data, and the request method is POST, this method MUST
     * return the contents of $_POST.
     *
     * Otherwise, this method may return any results of deserializing
     * the request body content; as parsing returns structured content, the
     * potential types MUST be arrays or objects only. A null value indicates
     * the absence of body content.
     *
     * @return null|array|object The deserialized body parameters, if any.
     *     These will typically be an array or object.
     */
    public function getParsedBody();

I suspect that the change from mentioned PR has also disabled Suggester, as this request also makes POST AJAX request.

@sebastian-meyer could you test it? For me suggester doesn't work, but 'm not sure if it is really buggy or my DDEV instance is too slow

Params from AJAX request are passed by POST so `getParsedBody` MUST be used.
page id should refer to the document storage page id not the current view page id
@beatrycze-volk beatrycze-volk changed the title Fix SearchiInDocument middleware [BUGFIX] Fix SearchiInDocument middleware Jun 4, 2024
@sebastian-meyer sebastian-meyer changed the title [BUGFIX] Fix SearchiInDocument middleware [BUGFIX] Fix SearchInDocument middleware Jun 4, 2024
@sebastian-meyer sebastian-meyer added the 🐛 bug A non-security related bug. label Jun 4, 2024
@sebastian-meyer
Copy link
Member

The code looks fine, but since I am at BiblioCon I can't test it right now. I'll have a look after my vacations.

@beatrycze-volk
Copy link
Collaborator Author

The code looks fine, but since I am at BiblioCon I can't test it right now. I'll have a look after my vacations.

Did you have time to look into it?

@sebastian-meyer
Copy link
Member

It doesn't work for me either, but that could be a problem of my environment as well, because the suggester didn't ever work here... ;o)

But since there is #454 which is part of an on-going re-work of the Solr integration by @frank-ulrich-weber, the suggester will be refactored, too. I suggest merging this PR (mainly for its maintenance changes) and then waiting for @frank-ulrich-weber to do his magic.

@sebastian-meyer sebastian-meyer merged commit 371076f into kitodo:master Jul 9, 2024
7 checks passed
@beatrycze-volk beatrycze-volk deleted the fix-searchindocument branch July 9, 2024 15:26
sebastian-meyer added a commit that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug A non-security related bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants