Bug 15739 - Saving a new printer profile does not work
Summary: Saving a new printer profile does not work
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 01:43 UTC by Aleisha Amohia
Modified: 2016-02-04 02:49 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2016-02-04 01:43:31 UTC
If you leave either the Printer Name or Paper Bin field empty (ie only putting something in one of those fields and leaving the other empty) then you will get a software error upon clicking Save

Can't call method "save" without a package or object reference at /home/vagrant/kohaclone/patroncards/edit-profile.pl line 72.
Comment 1 Chris Nighswonger 2016-02-04 02:49:36 UTC
Granted the error trapping here and feedback to the user leaves much to be desired, however, the behavior is as expected. Looking here:

http://tinyurl.com/z3t845z

will show that what we do is run a parameter check when asked to create a new Profile object. If all required parameters are not passed in, rather than returning a new object, -1 is returned which causes the attempt to invoke the save method to fail.

Its old code, and I never go back to adding proper error trapping. It really should not return -1 in any case.

In light of that, this bug should probably be closed RESOLVED WORKSFORME and another opened which addresses error trapping in the labels/patroncards code in general.