Summary: | Special kohaadmin cannot create lists | ||
---|---|---|---|
Product: | Koha | Reporter: | Amit Bondwal <bondwal.amit> |
Component: | Lists | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, kyle, m.de.rooy, verolencinas, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8641 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 9032 | ||
Bug Blocks: | |||
Attachments: |
Bug 8262: Special kohaadmin cannot create lists
Bug 8262: Follow-up for bootstrap theme Bug 8262: Special kohaadmin cannot create lists Attachment to Bug 8262 - Special kohaadmin cannot create lists [PASSED QA] Bug 8262: Special kohaadmin cannot create lists |
Description
Amit Bondwal
2012-06-18 07:30:22 UTC
Hi Amit, Could you please describe the exact steps to reproduce your problem. The more details you provide, the better help you may get. Are you using opac or staff client? Are you logged in? The problem is solved if you create the list logged in as a normal user (not kohaadmin). If you try to create a list logged in as administrator, you don't have a borrowernumber and koha can't create lists who don't belong to a user. I would like to reopen this report. verolencinas: What you say, is correct. But i would say that it is not a solution but a workaround. Koha should give a warning on screen here and not only produce a sql error in the logfile. I will submit a proposed patch soon to check the user and raise a warning in this situation. Marcel, Your patch would address Paul P.'s comment to following bug: Bug 8641 - Add information warning about log-in as root user to About->System information (Pushed to Master) See: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8641#c4 Marc Created attachment 25756 [details] [review] Bug 8262: Special kohaadmin cannot create lists Since kohaadmin has no borrower number, it cannot create lists. A database error is logged, but the user is not notified. This patch alerts the user (kohaadmin). In the incidental case that a normal user gets a database error, he is notified too that the list could not be created. Test plan: This patch should be applied on top of 9032 patches. Login as kohaadmin under opac and staff. Create a list in opac and staff. Check the message. Created attachment 25757 [details] [review] Bug 8262: Follow-up for bootstrap theme Provide a warning under bootstrap when kohaadmin tries to create a list. Test plan: Login as special kohaadmin. Create a list in OPAC with bootstrap theme. Check the message. I have built this upon patches for bug 9032. Please wait testing this until I submitted these patches. Thanks. Existing warnings in the staff client use the term "database administrator account." I think this patch should use the same phrase, instead of "special administrator account." Instead of having all this code in the perl scripts, wouldn't it be far simpler to to check C4::Context->userenv->{number} and display a warning that this account can't create a list? A TT plugin for userenv access could simplify this even more. I think a UserEnv sub that returned whatever $userenv->{$key} could easily be added to the Koha TT plugin. In addition, the code assumes that any failure should generate this message, which may not always be the case. I'd say that's a qa blocker. (In reply to Kyle M Hall from comment #9) > Instead of having all this code in the perl scripts, wouldn't it be far > simpler to to check C4::Context->userenv->{number} and display a warning > that this account can't create a list? > > A TT plugin for userenv access could simplify this even more. I think a > UserEnv sub that returned whatever $userenv->{$key} could easily be added to > the Koha TT plugin. > > In addition, the code assumes that any failure should generate this message, > which may not always be the case. I'd say that's a qa blocker. All this code is only a few lines (the AddShelf line is an improvement in any case). But I would not oppose a warning in the template either. A better message would be fine. The actual warning is now: List could not be created (which is pretty generic :) Between brackets, a reminder Do not use kohaadmin (which will be in this case btw a frequent cause). No blockers for me. How do we get this further now? Created attachment 25971 [details] [review] Bug 8262: Special kohaadmin cannot create lists Since kohaadmin has no borrower number, it cannot create lists. A database error is logged, but the user is not notified. This patch alerts the user (kohaadmin). In the incidental case that a normal user gets a database error, he is notified too that the list could not be created. Test plan (for prog and bootstrap): This patch should be applied on top of 9032 patches. Login as kohaadmin. Create a list in opac and staff. Check the message. Login as a normal user. Force a database error on list creation (I renamed category in the table with alter table change column..) You should have a different error message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> New patch includes the bootstrap change too now. Thanks Owen and Kyle for suggestions. Made the template varname generic and the error message dependent of loggedinuser. Created attachment 26066 [details] [review] Attachment to Bug 8262 - Special kohaadmin cannot create lists [SIGNED-OFF] Bug 8262: Special kohaadmin cannot create lists Since kohaadmin has no borrower number, it cannot create lists. A database error is logged, but the user is not notified. This patch alerts the user (kohaadmin). In the incidental case that a normal user gets a database error, he is notified too that the list could not be created. Test plan (for prog and bootstrap): This patch should be applied on top of 9032 patches. Login as kohaadmin. Create a list in opac and staff. Check the message. Login as a normal user. Force a database error on list creation (I renamed category in the table with alter table change column..) You should have a different error message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Created attachment 26526 [details] [review] [PASSED QA] Bug 8262: Special kohaadmin cannot create lists Since kohaadmin has no borrower number, it cannot create lists. A database error is logged, but the user is not notified. This patch alerts the user (kohaadmin). In the incidental case that a normal user gets a database error, he is notified too that the list could not be created. Test plan (for prog and bootstrap): This patch should be applied on top of 9032 patches. Login as kohaadmin. Create a list in opac and staff. Check the message. Login as a normal user. Force a database error on list creation (I renamed category in the table with alter table change column..) You should have a different error message. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works as described, passes tests and QA script. Pushed to master. Thanks, Marcel! |