In the main ILL requests table, the request ID is displayed as NaN. There are two problems here. Firstly, we're not populating id_prefix in the API response, it got missing in the deprecation of TO_JSON in bug 20996. As such, by the time we get to the JS that populates the ILL table, there is no id_prefix property in the row object, so concatenating undefined with an integer returns NaN.
Created attachment 82342 [details] [review] Bug 21835: Fix display of request ID We now populate the id_prefix property in the API response. It turns out that explicitly casting to a string wasn't necessary as JS does "the right thing" when concatenating a string and an integer Test plan: - Before applying the patch view the ILL requests table - TEST: Observe that the Request number column displays as NaN - Apply the patch - Refresh the page - TEST: Observe that the request number now displays correctly - Add the following block to your koha-conf.xml: <branch> <code>**The code of a branch that has an ILL request attached to it**</code> <prefix>YAY</prefix> </branch> - Refresh the page - TEST: Observe the request made on the branch that you specified in the config are now prefixed with "YAY-"
Created attachment 82343 [details] [review] Bug 21835: Fix display of request ID We now populate the id_prefix property in the API response. It turns out that explicitly casting to a string wasn't necessary as JS does "the right thing" when concatenating a string and an integer Test plan: - Before applying the patch view the ILL requests table - TEST: Observe that the Request number column displays as NaN - Apply the patch - Refresh the page - TEST: Observe that the request number now displays correctly - Add the following block to your koha-conf.xml: <branch> <code>**The code of a branch that has an ILL request attached to it**</code> <prefix>YAY</prefix> </branch> - Refresh the page - TEST: Observe the request made on the branch that you specified in the config are now prefixed with "YAY-" Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 82381 [details] [review] Bug 21835: Fix display of request ID We now populate the id_prefix property in the API response. It turns out that explicitly casting to a string wasn't necessary as JS does "the right thing" when concatenating a string and an integer Test plan: - Before applying the patch view the ILL requests table - TEST: Observe that the Request number column displays as NaN - Apply the patch - Refresh the page - TEST: Observe that the request number now displays correctly - Add the following block to your koha-conf.xml: <branch> <code>**The code of a branch that has an ILL request attached to it**</code> <prefix>YAY</prefix> </branch> - Refresh the page - TEST: Observe the request made on the branch that you specified in the config are now prefixed with "YAY-" Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Awesome work all! Pushed to master for 18.11
Created attachment 82405 [details] [review] Bug 21835: (QA follow-up) Fix failing test The illrequest api response should always be augmented with an id_prefix field which is not part of the core illrequest object
Not required for 18.05.x series.