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

Priti Pore <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |[email protected]
             Status|Pushed to stable            |RESOLVED

--- Comment #17 from Priti Pore <[email protected]> ---

Fix AcqCreateItem and UniqueItemFields boolean casting in orderreceive.tt

Open the file Template Toolkit file orderreceive.tt -
sudo nano +460
/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
Check for these two specific variables:
AcqCreateItem:
AcqCreateItem: [% Koha.Preference('AcqCreateItem') ? 1 : 0 | html %],
In Koha, the system preference AcqCreateItem is not a toggle (Yes/No). It is a
choice with three distinct string values:
        'ordering' → Create items when placing an order
        'receiving' → Create items when receiving an order
        'cataloguing' → Do not create items in acquisitions; create them later
in cataloguing
Later in orderreceive.tt, the script determines whether to show the item
subform and barcode fields
Because Koha.prefs.AcqCreateItem was converted to 1:
        The equality check 1 == 'receiving' evaluates to false.
        The equality check 1 == 'ordering' also evaluates to false.
The frontend JavaScript fails to match any valid workflow state. As a result,
it skips rendering the item input fields, suppresses the barcode inputs, and
leaves the modal stuck or the items table completely blank.
        The template must pass the raw string value enclosed in quotes::
AcqCreateItem: "[% Koha.Preference('AcqCreateItem') | html %]",

UniqueItemFields:
UniqueItemFields: [% Koha.Preference('UniqueItemFields') ? 1 : 0 | html %],
it sends 0 or 1. Downstream, Koha executes UniqueItemFields.split(','), which
throws TypeError: UniqueItemFields.split is not a function and freezes the
modal.
Change it to:
UniqueItemFields: "[% Koha.Preference('UniqueItemFields') | html %]",

Clear Cache and Restart
# Clear template compile cache
sudo rm -rf /var/cache/koha/vu-main/templates/*

# Restart Plack for vu-main (or Apache if not running Plack)
sudo koha-plack --restart vu-main
sudo systemctl restart apache2

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to