https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27363
Phil Ringnalda <p...@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |p...@chetcolibrary.org --- Comment #15 from Phil Ringnalda <p...@chetcolibrary.org> --- So confusing. At least I finally almost understand what I hacked around by editing localstorage to delete the wrong values I had after the change :) When you check or uncheck a server in the advanced search, https://git.koha-community.org/Koha-community/Koha/src/commit/0363d08a850f2d59cc9dd9b8a54d6bea1f7d7f83/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc#L719 saves "false" or "true" to localstorage for the closest data-server-id. https://git.koha-community.org/Koha-community/Koha/src/commit/e3c138c02951852166ec9258afcf1d426f955902/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc#L448 creates data-server-id with the index, not with the server_id that it used before bug 17515 landed. https://git.koha-community.org/Koha-community/Koha/src/commit/0363d08a850f2d59cc9dd9b8a54d6bea1f7d7f83/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc#L685 reads the values as though the key was still server_id, not index. Steps to reproduce: 1. Set EnableAdvancedCatalogingEditor to enable 2. Z39.50 servers, for LIBRARY OF CONGRESS uncheck preselected, and set rank to 2, and for NATIONAL LIBRARY OF FRANCE uncheck preselected, and set rank to 1 3. Open Firefox's Web Developer Tools, and in the Storage tab open Local Storage and select your URL 4. In the row for cateditor_preferences_{your user id}, if there are any values for selected_search_targets, delete them so you have "selected_search_targets":{} 5. Open the advanced editor, reopen Local Storage, then click Advanced » in the search box 6. Nothing is selected because you have no preselected servers. Click the box for Library of Congress, and close the advanced search popup, you now have "2": true in Local Storage 7. Open a new browser tab, open the advanced editor in it, and click Advanced » and note that you have nothing selected, because reading your "2": true as a server_id, server_id 2 is an authority server, so it's not there to select 8. Check and then uncheck the box for Library of Congress, and check the box for National Library of France. Local Storage now has "1":true,"2":false 9. Open a new browser tab, open the advanced editor in it, and click Advanced » and note that instead of having National Library of France selected, you have Library of Congress selected, because Library of Congress is index 2 but server_id 1. The trivial patch to read them as index instead of server_id works, but I'm not sure it's the right fix, since while testing it I would then swap my server rank around to have Library of Congress as 1 and National Library of France as 2, and as a result have the wrong one selected until I changed both checkboxes. Or without ranks, I would change the names so they sorted alphabetically the other way, and again have the wrong one selected. Is it worth the extra effort to maintain a map from index to server_id, so we can read and write server_id and map that to index? -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/