Repository: wagtail/wagtail

Issue:
HelpPanel broken in 3.0rc1
From a fresh bakerydemo project, edit bakerydemo/base/models.py, change the import at the top to

```
from wagtail.admin.edit_handlers import (
    FieldPanel,
    FieldRowPanel,
    InlinePanel,
    MultiFieldPanel,
    PageChooserPanel,
    StreamFieldPanel,
    HelpPanel,
)
```
and add to the top of the `content_panels` definition for HomePage:

    content_panels = Page.content_panels + [
        HelpPanel("<p>does this work?</p>"),
        MultiFieldPanel([

This causes `manage.py runserver` to fail with:

```
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/matthew/.virtualenvs/wagtail/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/Users/matthew/.virtualenvs/wagtail/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
    self.check(display_num_errors=True)
  File "/Users/matthew/.virtualenvs/wagtail/lib/python3.8/site-packages/django/core/management/base.py", line 487, in check
    all_issues = checks.run_checks(
  File "/Users/matthew/.virtualenvs/wagtail/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/checks.py", line 69, in get_form_class_check
    edit_handler = cls.get_edit_handler()
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/utils/decorators.py", line 54, in __call__
    return self.value
  File "/Users/matthew/.virtualenvs/wagtail/lib/python3.8/site-packages/django/utils/functional.py", line 49, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/utils/decorators.py", line 50, in value
    return self.fn(self.cls)
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 1083, in get_edit_handler
    return edit_handler.bind_to_model(cls)
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 207, in bind_to_model
    new.on_model_bound()
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 417, in on_model_bound
    self.children = [child.bind_to_model(self.model) for child in self.children]
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 417, in <listcomp>
    self.children = [child.bind_to_model(self.model) for child in self.children]
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 207, in bind_to_model
    new.on_model_bound()
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 417, in on_model_bound
    self.children = [child.bind_to_model(self.model) for child in self.children]
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 417, in <listcomp>
    self.children = [child.bind_to_model(self.model) for child in self.children]
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 205, in bind_to_model
    new = self.clone()
  File "/Users/matthew/Development/tbx/wagtail/devscript/wagtail/wagtail/admin/panels.py", line 120, in clone
    return self.__class__(**self.clone_kwargs())
TypeError: __init__() got an unexpected keyword argument 'base_form_class'
```

Tested on Wagtail 3.0rc1, Django 4.0.4, Python 3.8.0.


Discussion:

Resolving patch:
diff --git a/wagtail/admin/panels.py b/wagtail/admin/panels.py
--- a/wagtail/admin/panels.py
+++ b/wagtail/admin/panels.py
@@ -501,10 +501,9 @@ def __init__(
         self,
         content="",
         template="wagtailadmin/panels/help_panel.html",
-        heading="",
-        classname="",
+        **kwargs,
     ):
-        super().__init__(heading=heading, classname=classname)
+        super().__init__(**kwargs)
         self.content = content
         self.template = template
 


Test patch:
diff --git a/wagtail/test/testapp/models.py b/wagtail/test/testapp/models.py
--- a/wagtail/test/testapp/models.py
+++ b/wagtail/test/testapp/models.py
@@ -21,6 +21,7 @@
 from wagtail.admin.mail import send_mail
 from wagtail.admin.panels import (
     FieldPanel,
+    HelpPanel,
     InlinePanel,
     MultiFieldPanel,
     ObjectList,
@@ -216,6 +217,7 @@ class FilePage(Page):
 
     content_panels = [
         FieldPanel("title", classname="full title"),
+        HelpPanel("remember to check for viruses"),
         FieldPanel("file_field"),
     ]