Wagtail version change from 2.15.5 to 4.1(LTS)

31 views
Skip to first unread message

thiman samarasinghe

unread,
Nov 15, 2023, 9:41:37 AM11/15/23
to Wagtail support
HI All,

I tried to upgrade wagtail version to 4.1 for my old code.
Unfortunately I got these errors.
I had used BaseFormEditHandler class but I can not find out in version 4.1
Cannot find reference 'BaseFormEditHandler' in 'edit_handlers.py' 
Can somebody help me ?

Thank and Regard

Matthew Westcott

unread,
Nov 15, 2023, 9:56:36 AM11/15/23
to wag...@googlegroups.com
Hi,
Edit handlers were completely rewritten in Wagtail 3.0 - see https://docs.wagtail.org/en/stable/releases/3.0.html#api-changes-to-panels-edithandlers. The changes you need to make will depend on exactly what customisations you made originally - it's hard to give any specific advice, as BaseFormEditHandler was an internal class that wasn't intended to be used directly in end-user code.

Cheers,
- Matt

thiman samarasinghe

unread,
Nov 15, 2023, 11:06:13 AM11/15/23
to Wagtail support
 I need to replace this code .

def get_edit_handler(
  model: ModelBase, model_admin: Optional[ModelAdmin] = None
  ) -> BaseFormEditHandler:

Matthew Westcott

unread,
Nov 15, 2023, 1:26:17 PM11/15/23
to wag...@googlegroups.com
If you're only using BaseFormEditHandler as a type annotation, you can probably replace that with Panel (from wagtail.admin.panels import Panel) since all things that previously inherited from BaseFormEditHandler are panels.

- Matt
> --
> You received this message because you are subscribed to the Google Groups "Wagtail support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+u...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/fb882342-72ad-46dd-ab3e-22524383bfban%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages