Order receive page dies on error 500 if orders quantityreceived is more than 0. The error logs reads: "Template process failed: undef error - The method Koha::Item->count is not covered by tests!" This happens because in template orderreceive.tt we have "order.items.count" not "orders.items.count" as it should be. It seems that this error doesn't occur if template param edit is set as 1.
Created attachment 131939 [details] Bug 23376: Fix template error on order receive page Order receive page dies on error 500 if orders quantityreceived is more than 0. The error logs reads: "Template process failed: undef error - The method Koha::Item->count is not covered by tests!" In template orderreceive.tt we have "order.items.count" not "orders.items.count" as it should be. Note! It seems that this error doesn't occur if template param edit is set as 1.
I can't seem to trigger this, can you give a detailed test plan?
(In reply to Nick Clemens from comment #2) > I can't seem to trigger this, can you give a detailed test plan? It seems order also needs to have items listing. I'm now looking at two orders, both with quantityreceived 1 and only one of those which has items linked to it is throwing error 500. I'll provide new test plan after I've confirmed this.
(In reply to Emmi Takkinen from comment #3) > (In reply to Nick Clemens from comment #2) > > I can't seem to trigger this, can you give a detailed test plan? > > It seems order also needs to have items listing. I'm now looking at two > orders, both with quantityreceived 1 and only one of those which has items > linked to it is throwing error 500. I'll provide new test plan after I've > confirmed this. Been testing this in master and version 21.11.xx and it looks like this problem is only present in 21.11. In master we still have order.items.count and since order receive page works there without problem, it seems that line wasn't incorrect after all. Could it be something was fixed in master that fixed this?
Comment on attachment 131939 [details] Bug 23376: Fix template error on order receive page Obsoleting patch since it doesn't actually fix the problem.
So I've been testing this and it occurs in version 21.11.03 and the conditions are following: - order has _only one item_ attached to it - orders quantityreceived value is more than 0 For some reason when there's only one item on order template orderreceived.tt handles it as Koha::Item, not Koha::Items as it should, thus "Koha::Item->count is not covered by tests!". In orderreceived.pl order->items returns Koha::Items.
Hi Emmi, do you still see this issue and could you add a step by step on how to reproduce it?
Still seeing this on 21.11. To test: 1. Find order with one item and with quantity received as 1. 2. Navigate to receive this order from parcel.pl. 3. Click "Receive". OR 4. Use direct link to the order: /cgi-bin/koha/acqui/orderreceive.pl?ordernumber=<ordernumber>&invoiceid=<invoiceid> => error 500 is raised
(In reply to Emmi Takkinen from comment #8) > Still seeing this on 21.11. > > To test: > 1. Find order with one item and with quantity received as 1. > 2. Navigate to receive this order from parcel.pl. > 3. Click "Receive". > OR > 4. Use direct link to the order: > /cgi-bin/koha/acqui/orderreceive. > pl?ordernumber=<ordernumber>&invoiceid=<invoiceid> > => error 500 is raised Can you describe the basket settings? When are items being created? I could use a full walkthrough from basket creation to error as I am not overly familiar with acquisitions workflows
(In reply to Emmi Takkinen from comment #8) > Still seeing this on 21.11. > > To test: > 1. Find order with one item and with quantity received as 1. Wondering about this line - did you mean quantity ordered or indeed quantity received? If the item has been "fully" received, it should not show int he list of toe receive order lines. Could this be a data issue?
(In reply to Katrin Fischer from comment #10) > (In reply to Emmi Takkinen from comment #8) > > Still seeing this on 21.11. > > > > To test: > > 1. Find order with one item and with quantity received as 1. > > Wondering about this line - did you mean quantity ordered or indeed quantity > received? If the item has been "fully" received, it should not show int he > list of toe receive order lines. > > Could this be a data issue? I'm quite sure this caused by issue described in bug 32472.
Yeah, this most definitely is a same problem as in bug 32472. Setting this as duplicate. *** This bug has been marked as a duplicate of bug 32472 ***