| Summary: | Javascript error: Uncaught TypeError: $(...).sortable is not a function | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
| Component: | Architecture, internals, and plumbing | Assignee: | Marcel de Rooy <m.de.rooy> |
| Status: | CLOSED FIXED | QA Contact: | Emily Lamancusa (emlam) <emily.lamancusa> |
| Severity: | major | ||
| Priority: | P5 - low | CC: | emily.lamancusa, fridolin.somers, jonathan.druart, lucas, m.de.rooy, oleonard |
| Version: | Main | Keywords: | rel_23_11_candidate |
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Trivial patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: |
23.11.00
|
Circulation function: | |
| Bug Depends on: | 34114 | ||
| Bug Blocks: | 35304 | ||
| Attachments: |
Bug 35194: Remove obsoleted sortable function
Bug 35194: Remove obsoleted sortable function Bug 35194: Remove obsoleted sortable function |
||
|
Description
Katrin Fischer
2023-10-30 21:42:28 UTC
sortable() is a jQueryUI function which was removed from Koha. It looks like that line just needs to be removed:
- $("ul.sortable_subfield", clone).sortable();
Without it you can still sort and clone repeatable fields.
git grep "sortable("
koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt: $( ".pluginlist" ).sortable();
koha-tmpl/intranet-tmpl/prog/js/cataloging.js: $("ul.sortable_subfield", clone).sortable();
koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: // $('#sortable_stages').sortable('cancel');
This also breaks didyoumean configuration. Created attachment 158709 [details] [review] Bug 35194: Remove obsoleted sortable function Removes two occurrences and a commented one. Test plan: [1] Go to cataloguing editor. Open dev console. Clone 500. [2] Go to Admin/Did you mean. Try to toggle options. With this patch it works. Without this patch, JS errors. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> (In reply to Marcel de Rooy from comment #3) > This also breaks didyoumean configuration. This asks for Major imo. 22.11 grep gives me more results:
git grep "sortable("
koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt: $("#subfieldtabs > ul").sortable({
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt: $( "ul.sortable_field", "#authoritytabs" ).sortable();
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt: $( "ul.sortable_subfield", "#authoritytabs" ).sortable();
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt: $( "ul.sortable_field", "#addbibliotabs" ).sortable({
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt: $( "ul.sortable_subfield", "#addbibliotabs" ).sortable({
koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js: $("#subfieldtabs > ul").sortable({
koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js: $(".sortable").sortable();
koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: $('#sortable_stages').sortable({
koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: $('#sortable_stages').sortable('disable');
koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: $('#sortable_stages').sortable('cancel');
koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: $('#sortable_stages').sortable('enable');
(In reply to Marcel de Rooy from comment #6) > 22.11 grep gives me more results: > > git grep "sortable(" > koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt: > $("#subfieldtabs > ul").sortable({ > koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt: > $( "ul.sortable_field", "#authoritytabs" ).sortable(); > koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt: > $( "ul.sortable_subfield", "#authoritytabs" ).sortable(); > koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt: $( > "ul.sortable_field", "#addbibliotabs" ).sortable({ > koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt: $( > "ul.sortable_subfield", "#addbibliotabs" ).sortable({ > koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js: > $("#subfieldtabs > ul").sortable({ > koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js: > $(".sortable").sortable(); > koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: > $('#sortable_stages').sortable({ > koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: > $('#sortable_stages').sortable('disable'); > koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: > $('#sortable_stages').sortable('cancel'); > koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js: > $('#sortable_stages').sortable('enable'); No worries. 22.11 still has the library. Created attachment 158714 [details] [review] Bug 35194: Remove obsoleted sortable function Removes two occurrences and a commented one. Test plan: [1] Go to cataloguing editor. Open dev console. Clone 500. [2] Go to Admin/Did you mean. Try to toggle options. With this patch it works. Without this patch, JS errors. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Created attachment 158746 [details] [review] Bug 35194: Remove obsoleted sortable function Removes two occurrences and a commented one. Test plan: [1] Go to cataloguing editor. Open dev console. Clone 500. [2] Go to Admin/Did you mean. Try to toggle options. With this patch it works. Without this patch, JS errors. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Looks great! It seems like the new Sortable library never got added to the didyoumean page, though. I'll open a related bug for it. If it makes more sense to add a follow-up here instead, feel free to mark the new bug as a dupe and I'll QA the follow-up here. (In reply to Emily Lamancusa from comment #10) > It seems like the new Sortable library never got added to the didyoumean > page, though. I'll open a related bug for it. If it makes more sense to add > a follow-up here instead, feel free to mark the new bug as a dupe and I'll > QA the follow-up here. lol it was an easy fix. Patch uploaded on bug 35304 Pushed to master for 23.11. Nice work everyone, thanks! (In reply to Emily Lamancusa from comment #9) > Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Thanks Emily Depends on Bug 34114 not in 23.05.x |