[Koha-bugs] [Bug 22905] Cannot upate the status of suggestions if the branchcode filter is set to all

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 16 20:24:07 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22905

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #89828|0                           |1
        is obsolete|                            |

--- Comment #8 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 89868
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89868&action=edit
Bug 22905: Fix update of suggestion's status if branchcode filter is 'all'

Because of the "Library" filter on the left of the "Suggestions management"
screen, there is something wrong happening:

1. Create a suggestion from library A, login from library B
2. Go to  Home › Acquisitions › Suggestions management
=> The suggestion does not appear - OK
3. In the filter on the left, select "all library"
=> The suggestion appears on the pending tab - KO
4. Select the suggestion and mark is as 'Accepted'
=> The suggestion still appears on the pending tab - Failure

The log says:
DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key
constraint fails (`koha_kohadev`.`suggestions`, CONSTRAINT
`suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches`
(`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE) [for Statement "UPDATE
`suggestions` SET `accepteddate` = ?, `branchcode` = ?, `currency` = ?,
`manageddate` = ?, `price` = ?, `reason` = ?, `suggesteddate` = ?, `total` = ?
WHERE ( `suggestionid` = ? )" with ParamValues: 0='2019-05-14T15:48:18', 1="",
2="CAD", 3='2019-05-14T15:48:18', 4="0.00", 5="", 6='2019-05-14T00:00:00',
7="0.00", 8=3] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.

Let forget what could have happened earlier in the script and do it the regular
way, from $input. Then call ModSuggestion with only what we need.

Test plan:
Confirm that the steps described before work as expected once this patch is
applied

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list