Skip to content

Fix: Load Sortable.js library in document templates page - #156

Merged
itshypax merged 2 commits into
mainfrom
copilot/fix-sortable-template-error
Nov 6, 2025
Merged

Fix: Load Sortable.js library in document templates page#156
itshypax merged 2 commits into
mainfrom
copilot/fix-sortable-template-error

Conversation

Copilot AI commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Issue: "Sortable is not defined" error when loading document templates (v0.5.2.2)

The templates page instantiates Sortable for drag-and-drop field ordering but never loads the library.

Changes:

  • Added <script> tag to load Sortable.min.js in settings/documents/templates.php
<head>
    <?php include __DIR__ . '/../../assets/components/_base/admin/head.php'; ?>
    <script src="<?= BASE_PATH ?>assets/_ext/sortablejs/Sortable.min.js"></script>
    <style>

This ensures the library is available before the page JavaScript executes new Sortable(fieldList, {...}) on line 510.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fehler beim Laden des Templates: Sortable is not defined</issue_title>
<issue_description>## Reproduzierbar?
Konntest du den Fehler selbst erneut provozieren?

  • Ja
  • Nein

Wo tritt der Fehler auf?

  • Computer (Browser)
  • Handy (Browser)
  • Ingame (intraTab)

Welche Version wird verwendet?

Version 0.5.2.2

Beschreibe den Fehler

Fehler
Fehler beim Laden des Templates: Sortable is not defined bei bestehenden (Standard‑) Dokumenten

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error loading template: Sortable is not defined Fix: Load Sortable.js library in document templates page Nov 6, 2025
Copilot AI requested a review from itshypax November 6, 2025 18:50
@itshypax
itshypax marked this pull request as ready for review November 6, 2025 18:50
@itshypax
itshypax merged commit 1efc42e into main Nov 6, 2025
2 checks passed
@itshypax
itshypax deleted the copilot/fix-sortable-template-error branch November 6, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fehler beim Laden des Templates: Sortable is not defined

2 participants