torchbox / wagtailmedia

A Wagtail module for managing video and audio files within the admin
https://pypi.org/project/wagtailmedia/
BSD 3-Clause "New" or "Revised" License
224 stars 70 forks source link

Change `SearchField(..., partial_match=True)` to `AutocompleteField()`: RemovedInWagtail60Warning #203

Closed jamesbiggs closed 1 year ago

jamesbiggs commented 1 year ago

Issue Summary

When upgrading to wagtail 5.0 and upgrading wagtailmedia to 0.14, I get a RemovedInWagtail60Warning for the SearchField partial_match, telling me it'll be removed in wagtail 6.0

https://github.com/torchbox/wagtailmedia/blob/4bb6106236d7dffca50d7b8e25c4d5017fe6deb1/src/wagtailmedia/models.py#L70

This is the line of code that it arises from.

Steps to Reproduce

  1. Upgrade to wagtail 5.0
  2. Upgrade to wagtailmedia 0.14
  3. See that you get a deprecation warning

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

I believe this shouldn't happen as it's a relatively small fix - change SearchField with partial_match=True to AutocompleteField.

Technical details

jamesbiggs commented 1 year ago

I've made a PR here which should solve this issue: https://github.com/torchbox/wagtailmedia/pull/204 @zerolab

jamesbiggs commented 1 year ago

Fixed in https://github.com/torchbox/wagtailmedia/releases/tag/v0.14.1