The error appears in both the cataloguing and authority editor. Go to a repeatable field, like 500. Repeat it with the console open: Uncaught TypeError: $(...).sortable is not a function
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