Skip to content

v1.3.1 - FilterFieldError for ParentalManyToManyField #100

Description

@aliceni81

Issue summary

I upgrade the wagtail to v7.4.1, using wagtail.search.backends.database as WAGTAILSEARCH_BACKENDS

Steps to reproduce

my code is

from modelcluster.fields import ParentalManyToManyField
class ArticlePage(Page):
research_services = ParentalManyToManyField(ResearchService)
search_fields = Page.search_fields + [
        index.FilterField('researchservice_id'),
    ]

it works well using v1.2.2, but raise FilterFieldError "Cannot filter search results with field "researchservice_id". Please add a suitable index.RelatedFields definition to GKArticlePage.search_fields." using v1.3.1.
I try to change the code to

index.RelatedFields('research_services', [
            index.FilterField('researchservice_id'),
        ]),

but still the same error arise.

Please help!!

Additional information

No response

Can be reproduced

Not confirmed

Technical details

  • Python version: Run python --version.
  • Django version: Look in your requirements.txt, or run pip show django | grep Version.
  • Wagtail version: Look at the bottom of the Settings menu in the Wagtail admin, or run pip show wagtail | grep Version:.
  • Browser version: You can use https://www.whatsmybrowser.org/ to find this out.

Working on this

If you would like to contribute to this issue, follow these steps:

  • Confirm that the issue is reproducible, either on a fresh Wagtail project or the bakerydemo.
  • Once confirmed, view our contributing guidelines, add a comment to the issue once you're ready to start.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions