I have some libraries that are entered into Koha as borrowers, using the surname field for the name of the library and not using the firstname field. When these libraries are listed in the Patron column of the ILL requests table, the missing firstname is shown as "null", so the name is displayed as "null Some Library". I think the problem is somewhere in the conversion from DB "NULL" to JSON.
The JSON looks like this: "firstname":null,"surname":"Uppsala universitetsbibliotek"
Created attachment 80679 [details] [review] Bug 21585 - Ignore missing firstname in ILL requests table To test: - Make sure you have a patron with just a surname and no firstname - Create an ILL request so that the name of this patron shows up in the Patron column of the ILL requests table - Before the patch, the name will display as "null Surname" - Apply the patch - Reload the ILL requests page - The name should now display as just "Surname" - Sign ye merrily off
I can't replicate this on master now. I'm wondering if one of the ILL bugs that has been merged recently has inadvertently fixed it. Can you still replicate it Magnus?
I can't reproduce this bug either.
Thanks for testing, Andrew and Owen! I still see the problem, and I think I know what is happening: If you create a regular, adult type user and give it only a surname, the firstname field in the database will be the empty string. This will display fine in the Patron column of the "List requests" table. If you create a user that is of the Organization type, the field for firstname will not be displayed, and the database column will be NULL. This will display as "null" in the Patron column. Could you please check your borrowers.firstname columns and see if this could explain what you are seeing?
Aha! You're right! Creating an organisational user then creating a request for them does indeed demonstrate the problem. I'll test your patch now and sign off.
Created attachment 81686 [details] [review] Bug 21585 - Ignore missing firstname in ILL requests table To test: - Make sure you have a patron with just a surname and no firstname - Create an ILL request so that the name of this patron shows up in the Patron column of the ILL requests table - Before the patch, the name will display as "null Surname" - Apply the patch - Reload the ILL requests page - The name should now display as just "Surname" - Sign ye merrily off Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Created attachment 81723 [details] [review] Bug 21585: Ignore missing firstname in ILL requests table To test: - Make sure you have a patron with just a surname and no firstname - Create an ILL request so that the name of this patron shows up in the Patron column of the ILL requests table - Before the patch, the name will display as "null Surname" - Apply the patch - Reload the ILL requests page - The name should now display as just "Surname" - Sign ye merrily off Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.06
Pushed to 17.11.x for 17.11.13