There is a foreign key constraint, we get an internal server error when trying to save branchcode 'Any' = ''
Created attachment 96284 [details] [review] Bug 24244: Send null instead of empty string if branch not set
Created attachment 96293 [details] [review] Bug 24244: Add test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 96294 [details] [review] Bug 24244: Send null instead of empty string if branch not set Fix NewSuggestion if branchcode is passed with an empty string. Error was "Broken FK constraint" Test plan: Create a new suggestion, select "any" for the library. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
After this change the purchase suggestion would not be shown in the list at </cgi-bin/koha/suggestion/suggestion.pl>. So I would like to see a patch that handles these any library suggestions before we merge this otherwise I think we are left with a even worse situation where we have patrons submitting suggestions successfully" but then the librarians never knowing about them.
(In reply to Joonas Kylmälä from comment #4) > After this change the purchase suggestion would not be shown in the list at > </cgi-bin/koha/suggestion/suggestion.pl>. So I would like to see a patch > that handles these any library suggestions before we merge this otherwise I > think we are left with a even worse situation where we have patrons > submitting suggestions successfully" but then the librarians never knowing > about them. This is a regression - in the past we could create these suggestions and they have never been shown by default. You should be able to see them by opening the Acquisition information filter and setting library to Any Making that more obvious is a separate bug
It appears to fix the staff side, but we still got big trouble in the OPAC: - Activate anonymous suggestions for the OPAC - Place a suggestion while logged out - Boom! Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88 Leaving this bug right now as I think we could add the important OPAC (end users!) fix into this one.
(In reply to Katrin Fischer from comment #6) > It appears to fix the staff side, but we still got big trouble in the OPAC: > - Activate anonymous suggestions for the OPAC > - Place a suggestion while logged out > - Boom! > > Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88 It works for me.
(In reply to Jonathan Druart from comment #7) > (In reply to Katrin Fischer from comment #6) > > It appears to fix the staff side, but we still got big trouble in the OPAC: > > - Activate anonymous suggestions for the OPAC > > - Place a suggestion while logged out > > - Boom! > > > > Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88 > > It works for me. Strange :( I can retest, but thought I had made sure yesterday to restart everything.
(In reply to Katrin Fischer from comment #8) > (In reply to Jonathan Druart from comment #7) > > (In reply to Katrin Fischer from comment #6) > > > It appears to fix the staff side, but we still got big trouble in the OPAC: > > > - Activate anonymous suggestions for the OPAC > > > - Place a suggestion while logged out > > > - Boom! > > > > > > Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88 > > > > It works for me. > > Strange :( I can retest, but thought I had made sure yesterday to restart > everything. I still see the error, double checked that I had the patches applied and 'restart_all' was done before testing. I think the problem is, that I hadn't set an Anonymous patron, it was still the default of 0. - Not sure if this is a bug we need to fix. Signing off now.
Created attachment 96728 [details] [review] Bug 24244: Add test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 96729 [details] [review] Bug 24244: Send null instead of empty string if branch not set Fix NewSuggestion if branchcode is passed with an empty string. Error was "Broken FK constraint" Test plan: Create a new suggestion, select "any" for the library. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
> I still see the error, double checked that I had the patches applied and > 'restart_all' was done before testing. I think the problem is, that I hadn't > set an Anonymous patron, it was still the default of 0. - Not sure if this > is a bug we need to fix. Signing off now. ... or if we want to, fix separately as the issue seems to be a different constraint?
(In reply to Katrin Fischer from comment #6) > It appears to fix the staff side, but we still got big trouble in the OPAC: > - Activate anonymous suggestions for the OPAC > - Place a suggestion while logged out > - Boom! > > Broken FK constraint at /usr/share/perl5/Exception/Class/Base.pm line 88 Opened bug 24327.
Nice work everyone! Pushed to master for 20.05
pushed to 19.11.x for 19.11.02
backported to 19.05.x for 19.05.07