Bug 21537

Summary: Template error when creating a new order from a suggestion
Product: Koha Reporter: Oliver Behnke <oliver.behnke>
Component: AcquisitionsAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19289
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19289    
Bug Blocks:    
Attachments: Bug 21537: Fix itemtype processing
Bug 21537: Fix typo for options_for_item_types
Bug 21537: Fix typo for options_for_item_types

Description Oliver Behnke 2018-10-10 14:50:01 UTC
Hi,

we just ran across the following error when creating a new book order based on a suggestion:

> Template process failed: file error - options_for_itemtypes: not found at /usr/share/koha/lib/C4/Templates.pm line 122

Investigating the problem I found a regression in #19289 where a new template processor called "options_for_item_types" got added to intranet-tmpl/prog/en/includes/html_helpers.inc. However, in intranet-tmpl/prog/en/modules/acqui/neworderempty.tt it's called as "options_for_itemtypes". Note the missing underscore in "itemtypes".

Cheers
Comment 1 Nick Clemens (kidclamp) 2018-10-10 15:06:36 UTC
Created attachment 80359 [details] [review]
Bug 21537: Fix itemtype processing

To test:
 0 - Set UseACQFrameworkForBiblioRecords to 'Use'
 1 - Define a subfield in the ACQ framework linked to authorised value
 'itemtypes'
 2 - Make sure that field is visible
 3 - Create a purchase suggestion
 4 - Accept it
 5 - Go to Acquisitions
 6 - Find a vendor with an open basket, or create one
 7 - Add to the basket using a suggestion
 8 - Choose the suggestion
 9 - Internal server error
10 - Apply patch
11 - Place order form a suggestion again
12 - Confirm that the field linked to itemtypes shows correctly
Comment 2 Jonathan Druart 2018-10-12 13:42:01 UTC
Created attachment 80477 [details] [review]
Bug 21537: Fix typo for options_for_item_types

To test:
 0 - Set UseACQFrameworkForBiblioRecords to 'Use'
 1 - Define a subfield in the ACQ framework linked to authorised value
 'itemtypes'
 2 - Make sure that field is visible
 3 - Create a purchase suggestion
 4 - Accept it
 5 - Go to Acquisitions
 6 - Find a vendor with an open basket, or create one
 7 - Add to the basket using a suggestion
 8 - Choose the suggestion
 9 - Internal server error
10 - Apply patch
11 - Place order form a suggestion again
12 - Confirm that the field linked to itemtypes shows correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Martin Renvoize 2018-10-12 14:13:56 UTC
Created attachment 80504 [details] [review]
Bug 21537: Fix typo for options_for_item_types

To test:
 0 - Set UseACQFrameworkForBiblioRecords to 'Use'
 1 - Define a subfield in the ACQ framework linked to authorised value
 'itemtypes'
 2 - Make sure that field is visible
 3 - Create a purchase suggestion
 4 - Accept it
 5 - Go to Acquisitions
 6 - Find a vendor with an open basket, or create one
 7 - Add to the basket using a suggestion
 8 - Choose the suggestion
 9 - Internal server error
10 - Apply patch
11 - Place order form a suggestion again
12 - Confirm that the field linked to itemtypes shows correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2018-10-12 14:14:43 UTC
Another trivial patch which resolves the problem and causes no regressions.

Passing QA
Comment 5 Nick Clemens (kidclamp) 2018-10-15 17:06:04 UTC
Awesome work all!

Pushed to master for 18.11
Comment 6 Martin Renvoize 2018-10-17 10:35:52 UTC
Pushed to 18.05.x for 18.05.05
Comment 7 Fridolin Somers 2018-11-09 08:17:29 UTC
Depends on Bug 19289 not in 17.11.x