Bug 13329

Summary: Can't make new suggestion with AllowPurchaseSuggestionBranchChoice turned on
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P5 - low CC: dcook, jonathan.druart, katrin.fischer, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 12627    
Bug Blocks:    
Attachments: Bug 13329: Fix create a suggestion at the OPAC
Bug 13329: Fix create a suggestion at the OPAC
[PASSED QA] Bug 13329: Fix create a suggestion at the OPAC

Description Katrin Fischer 2014-11-24 06:37:43 UTC
If you try to create a new suggestion from OPAC and AllowPurchaseSuggestionBranchChoice is turned on, it will result in a perl error:

DBIx::Class::Row::new(): No such column 'branch' on Koha::Schema::Result::Suggestion at /home/katrin/kohaclone/C4/Suggestions.pm line 449
Comment 1 Jonathan Druart 2014-11-24 08:58:07 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2014-11-24 13:46:46 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-11-24 20:36:50 UTC
Created attachment 33877 [details] [review]
[PASSED QA] Bug 13329: Fix create a suggestion at the OPAC

The suggestion table does not contain a 'branch' column name.
The script should pass 'branchcode' to C4::Suggestion::NewSuggestion.

Test plan:
0/ Enable the AllowPurchaseSuggestionBranchChoice pref
1/ Create a suggestion at the OPAC should not raise a DBIx::Class error.

I could reproduce the bug.
With patch bug is gone.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, thx for the quick fix.
Comment 4 David Cook 2014-11-25 05:14:30 UTC
Yay team! That was lightning fast!
Comment 5 Tomás Cohen Arazi 2014-11-25 18:39:22 UTC
Patch pushed to master.

Thanks Jonathan!