https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23998 --- Comment #19 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- (In reply to Andrew Fuerste-Henry from comment #14)
I've got a test failure: * Proving /kohadevbox/koha/t/db_dependent/api/v1/messages.t FAIL
# Failed test at /kohadevbox/koha/t/db_dependent/api/v1/messages.t line 253. # found warning: Duplicate ID at /kohadevbox/koha/Koha/Object.pm line 176. # expected to find warning: (?^u:DBD::mysql::st execute failed: Duplicate entry '(.*?)' for key 'PRIMARY') # Looks like you failed 1 test of 27.
# Failed test 'add() tests' # at /kohadevbox/koha/t/db_dependent/api/v1/messages.t line 256. # Looks like you failed 1 test of 6. /kohadevbox/koha/t/db_dependent/api/v1/messages.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests
Also, I don't think you've got required permissions set as they should be. you've got: listMessages: requires full "borrowers" permission getMessage: requires full "borrowers" permission
But in the staff interface a user with only "list_borrowers" can see messages on any patron at their library or group. With "view_borrower_infos_from_any_libraries" they can view messages on any patron.
These permission requirements do correctly match what's required in the staff interface: addMessage: requires "edit_borrowers" permission updateMessage: requires "edit_borrowers" permission deleteMessage: requires "edit_borrowers" permission
Should be fixed (In reply to Andrew Fuerste-Henry from comment #15)
When updating a message, why is one required to include the message_type, patron_id, and message content in the body of the request? If all I want to change is the patron_read_date, why not send only that in the body?
I put those fields as required because they are database fields that are not nullable and without a default value. I agree it's not logical to require them for a put request, but I am unsure how I should resolve this. I wouldn't just remove the requirements because of post but I don't think duplicating the definition file for put is good either. This issue seems to be present for the patron api post vs. put path/definition as well (required: surname, library_id, category_id) if I am not mistaken. Any advice? -- You are receiving this mail because: You are watching all bug changes.