Bug 17515 added "rank" to the ORDER BY without quoting it. Since it's a reserved keyword in MySQL 8, this causes a syntax error which causes the advanced editor to throw a fatal 500 error.
Created attachment 149008 [details] [review] Bug 33375: Quote reserved keyword 'rank' in advanced editor This change quotes the 'rank' keyword in the advanced editor, so that it doesn't cause fatal crashes when using MySQL 8 Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Enable advanced editor http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnableAdvancedCatalogingEditor 2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl#new/ 3. Click on "Advanced" on the left nav 4. Note that "LIBRARY OF CONGRESS" is ordered before "NATIONAL LIBRARY OF FRANCE" 5. Rejoice!
Created attachment 149056 [details] [review] Bug 33375: Quote reserved keyword 'rank' in advanced editor This change quotes the 'rank' keyword in the advanced editor, so that it doesn't cause fatal crashes when using MySQL 8 Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Enable advanced editor http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnableAdvancedCatalogingEditor 2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl#new/ 3. Click on "Advanced" on the left nav 4. Note that "LIBRARY OF CONGRESS" is ordered before "NATIONAL LIBRARY OF FRANCE" 5. Rejoice! Signed-off-by: David Nind <david@davidnind.com>
Testing notes using KTD: 1. To start KTD with MySQL instead of MariaDB: before starting KTD, change .env so that DB_IMAGE=mysql:8.0 2. Replicated the issue. 3. Applied the patch and followed the test plan.
Created attachment 149633 [details] [review] Bug 33375: Quote reserved keyword 'rank' in advanced editor This change quotes the 'rank' keyword in the advanced editor, so that it doesn't cause fatal crashes when using MySQL 8 Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Enable advanced editor http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnableAdvancedCatalogingEditor 2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl#new/ 3. Click on "Advanced" on the left nav 4. Note that "LIBRARY OF CONGRESS" is ordered before "NATIONAL LIBRARY OF FRANCE" 5. Rejoice! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.13.
*** Bug 33714 has been marked as a duplicate of this bug. ***
*** Bug 31859 has been marked as a duplicate of this bug. ***
applied to 21.11 for 21.11.21
*** Bug 29973 has been marked as a duplicate of this bug. ***