Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Wagtail 5.0 fixes #543

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Wagtail 5.0 fixes #543

merged 2 commits into from
Oct 10, 2023

Conversation

katdom13
Copy link
Collaborator

@katdom13 katdom13 commented Oct 10, 2023

Parent PR: #503

Supplementary fixes:

Snippet choosers with searchable snippets were displaying the search box, but not returning any results when the user enters a search query. This is due to a change in internal behaviour:

Wagtail 4.2 used to fall back to a partial_match search if there was no autocomplete option available in the Snippet's .search_fields

Wagtail 5.0 expects there to be an AutocompleteField

The release notes allude to it, but don't quite make this clear. The fix is to make sure that your Snippet has an AutocompleteField configured, e.g:

search_fields = [
    index.AutocompleteField("title"), (added line)
    index.SearchField("title"),
]
  • Need to run update_index

Copy link
Contributor

@victoriachan victoriachan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@zerolab zerolab merged commit 20cc072 into main Oct 10, 2023
@zerolab zerolab deleted the fix/wagtail-50 branch October 10, 2023 13:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants