from .base import *  # noqa @UnusedWildImport

DEBUG = True


for template_engine in TEMPLATES:
    template_engine["OPTIONS"]["debug"] = True


EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"


try:
    import debug_toolbar  # @UnusedImport

    MIDDLEWARE = list(MIDDLEWARE) + [
        "debug_toolbar.middleware.DebugToolbarMiddleware",
    ]
    INSTALLED_APPS = list(INSTALLED_APPS) + ["debug_toolbar"]
    INTERNAL_IPS = ("127.0.0.1",)
    DEBUG_TOOLBAR_CONFIG = {"INTERCEPT_REDIRECTS": False}
except ImportError:
    pass

testproject/testproject/settings/dev.py
from .base import *  # noqa @UnusedWildImport

DEBUG = True


for template_engine in TEMPLATES:
    template_engine["OPTIONS"]["debug"] = True


EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"

INTERNAL_IPS = ["127.0.0.1"]
ALLOWED_HOSTS = [
    "localhost",
    "0.0.0.0",
    "127.0.0.1",
]
SESSION_COOKIE_DOMAIN = ".localhost"

SESSION_COOKIE_SECURE = False

try:
    import debug_toolbar  # @UnusedImport

    MIDDLEWARE = list(MIDDLEWARE) + [
        "debug_toolbar.middleware.DebugToolbarMiddleware",
    ]
    INSTALLED_APPS = list(INSTALLED_APPS) + ["debug_toolbar"]
    INTERNAL_IPS = ("127.0.0.1",)
    DEBUG_TOOLBAR_CONFIG = {"INTERCEPT_REDIRECTS": False}
except ImportError:
    pass

testproject/testproject/settings/dev.py
diff --git a/docs/release_notes.rst b/docs/release_notes.rst
index 9368dcab1..fbbcdb399 100644
--- a/docs/release_notes.rst
+++ b/docs/release_notes.rst
@@ -18,7 +18,7 @@ Release plan
 -----------------
 
 * Removed direct dependency on ``tinycss2``, inherited from ``bleach`` - due to old versions of pip unable to resolve
-
+* Fixed wrong CSS class for collapse elements in Bootstrap 4 :url-issue:`1208` (Oscar Cortez)
 
 0.9
 ---
diff --git a/src/wiki/plugins/attachments/templates/wiki/plugins/attachments/index.html b/src/wiki/plugins/attachments/templates/wiki/plugins/attachments/index.html
index 14fc5d2b6..ab1e3f175 100644
--- a/src/wiki/plugins/attachments/templates/wiki/plugins/attachments/index.html
+++ b/src/wiki/plugins/attachments/templates/wiki/plugins/attachments/index.html
@@ -75,8 +75,7 @@ <h4 style="margin-top:0;">
             <p class="card-title"><span class="fa fa-fw fa-upload"></span> {% trans "Upload new file" %}</p>
           </a>
         </div>
-
-        <div id="collapse_upload" class="card-collapse collapse{% if form.errors %} in{% endif %}">
+        <div id="collapse_upload" class="card-collapse collapse{% if form.errors %} show{% endif %}">
           <div class="card-body">
             {% if anonymous_disallowed %}
               {% include "wiki/includes/anonymous_blocked.html" %}
diff --git a/src/wiki/templates/wiki/includes/editor_sidebar.html b/src/wiki/templates/wiki/includes/editor_sidebar.html
index 36c067841..e760fc016 100644
--- a/src/wiki/templates/wiki/includes/editor_sidebar.html
+++ b/src/wiki/templates/wiki/includes/editor_sidebar.html
@@ -22,7 +22,7 @@
       </a>
     </div>
 
-    <div id="collapse_{{ plugin.slug }}" class="card-collapse collapse{% if plugin_form.errors %} in{% endif %}">
+    <div id="collapse_{{ plugin.slug }}" class="card-collapse collapse{% if plugin_form.errors %} show{% endif %}">
       <div class="card-body form-vertical">
         {% if plugin.sidebar.template %}
           {% with plugin_form as form and plugin as plugin %}
diff --git a/src/wiki/templates/wiki/includes/formfield.html b/src/wiki/templates/wiki/includes/formfield.html
index e916bf5f9..3a77cbc60 100644
--- a/src/wiki/templates/wiki/includes/formfield.html
+++ b/src/wiki/templates/wiki/includes/formfield.html
@@ -14,11 +14,11 @@
     <div class="flex-wrap">{{ field }} {% if field.field.required %}<span class="asteriskField">*</span>{% endif %}</div>
     {% if field.errors %}
       {% for error in field.errors %}
-        <div id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="help-block"><strong>{{ error }}</strong></div>
+        <div id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="invalid-feedback d-block">{{ error }}</div>
       {% endfor %}
     {% endif %}
     {% if field.help_text %}
-      <p id="hint_{{ field.auto_id }}" class="help-block">{{ field.help_text|safe }}</p>
+      <p id="hint_{{ field.auto_id }}" class="form-text text-muted">{{ field.help_text|safe }}</p>
     {% endif %}
   </div>
 </div>
diff --git a/testproject/testproject/settings/dev.py b/testproject/testproject/settings/dev.py
index fcd42254d..cb3b81bf5 100644
--- a/testproject/testproject/settings/dev.py
+++ b/testproject/testproject/settings/dev.py
@@ -9,6 +9,15 @@
 
 EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
 
+INTERNAL_IPS = ["127.0.0.1"]
+ALLOWED_HOSTS = [
+    "localhost",
+    "0.0.0.0",
+    "127.0.0.1",
+]
+SESSION_COOKIE_DOMAIN = ".localhost"
+
+SESSION_COOKIE_SECURE = False
 
 try:
     import debug_toolbar  # @UnusedImport

Warning of illegal attachment types are auto collapsed and thus invisible
I am reporting a bug in the attachment plugin.

When you try to upload something illegal (SVG, jpg), it used to (just upgrade from 0.5 to 0.9) show a warning in red text and the Upload a new file section and the section is not collapsed.
Now it still has the warning text but the section is automatically collapsed. This is confusing. Also, the text is in black instead of red (I think it's okay).

After trying to upload SVG:
![image](https://user-images.githubusercontent.com/10136589/190052771-a521cfff-b537-4edf-b6b4-ccfe3a12d378.png)
No warning is shown, but when you click Upload a new file, it's just hidden there:
![image](https://user-images.githubusercontent.com/10136589/190052681-f511a0ac-83f8-4594-977e-8dda4ff206fd.png)

Django version: 4.0.7
Python version: 3.10.5
Platform: Windows 10
django-wiki version: 0.9
