Bug 14489 - Software error when trying to create new batch
Summary: Software error when trying to create new batch
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Héctor Eduardo Castro Avalos
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-03 11:44 UTC by su966
Modified: 2016-12-05 21:22 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14489: Patron card creator fail when login with database administrator account (3.16 KB, patch)
2016-01-21 21:03 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description su966 2015-07-03 11:44:57 UTC
Koha version:	3.20.01.000
OS version ('uname -a'):	Linux Library 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
===================================================================

I am getting error message when trying to create patron card. I followed the method as follows: 

Patron Card Creator Home
New Batch -->Add Items -->Add

Error Comes as follows:



Software error:

Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /usr/share/koha/intranet/cgi-bin/patroncards/edit-batch.pl line 125.
For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.
Comment 1 Jonathan Druart 2015-07-14 16:24:56 UTC
I'd you have not defined a batch, could you confirm?

select count(*) from creator_batches where creator="Patroncards"?

Why did you open this issue in the Koha security project?
Comment 2 Jonathan Druart 2015-07-14 16:25:11 UTC
say*
Comment 3 Bernardo Gonzalez Kriegel 2015-07-15 00:58:38 UTC
Can't reproduce.

Can create new batches without 'this' problem
What I found is that if you press new batch you get a window
saying that there are no items (patrons) for batch '0'
Pressing add items, a new window pops to search and add new patrons.
If you press a couple of 'Add' from search results you end with
many 'new' batches with '1' patron each
Comment 4 Liz Rea 2015-07-16 10:37:19 UTC
This is not a security bug. :)
Comment 5 Xoxo 2016-01-18 16:56:45 UTC
How to make a solutions for this error?
Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /usr/share/koha/intranet/cgi-bin/patroncards/edit-batch.pl line 125.
Comment 6 Jonathan Druart 2016-01-19 08:47:57 UTC
You have to create a new batch and then add items.
Comment 7 Héctor Eduardo Castro Avalos 2016-01-21 20:49:12 UTC
This has been changed a little bit, but problem remain there.

To reproduce the issue:

1)Log in as database administrator account.
2)Goto Tools > Patron card creator > Batches > New > Card batch
3)Get notice the label "Current library: NO_LIBRARY_SET"
4)Add a borrowernumber like 51 and click in button Add patron(s)
5)The error is launched.
6)Log out the user and login with another admin account with the librarian permissions.
7)Repeat the steps 1 to 6.
Comment 8 Héctor Eduardo Castro Avalos 2016-01-21 21:03:05 UTC
Created attachment 47146 [details] [review]
Bug 14489: Patron card creator fail when login with database administrator account

To reproduce the issue:

1)Log in as database administrator account.
2)Goto Tools > Patron card creator > Batches > New > Card batch
3)Get notice the label "Current library: NO_LIBRARY_SET"
4)Add a borrowernumber like 51 and click in button Add patron(s)
5)The error is launched.
6)Log out the user and login with another admin account with the librarian
permissions.
7)Repeat the steps 1 to 6.

To test:
-Apply patch
-Follow steps 1 to 6
-Notice about the new informational message "Set library"
-Also see the warning message displayed when add patron 51.
Koha should not fail
Comment 9 Liz Rea 2016-01-21 21:10:14 UTC
I don't really it is a problem that the database administrator account can't create batches. You shouldn't be using that account to do work.

Liz
Comment 10 Héctor Eduardo Castro Avalos 2016-01-21 21:34:19 UTC
You're right Liz(In reply to Liz Rea from comment #9)
> I don't really it is a problem that the database administrator account can't
> create batches. You shouldn't be using that account to do work.
> 
> Liz

You're right Liz. The software doesn't crash in a normal way.

What do you think about this, Jonathan?

If you prefer guys close the bug. No biggie if you feel this patch doesn't apply.
Comment 11 Jonathan Druart 2016-01-22 08:32:15 UTC
If the error only occurs when you are logged in with the admin user, this bug is invalid.