Bug 5002 - No error message if category code already exists
Summary: No error message if category code already exists
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL: /admin/categorie.pl
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 15:21 UTC by Katrin Fischer
Modified: 2015-12-03 22:11 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 5002: Display messages on adding/deleting patron category (7.94 KB, patch)
2015-03-24 11:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 5002: Display messages on adding/deleting patron category (8.13 KB, patch)
2015-03-25 16:06 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 5002: Show all patron categories after insert (2.08 KB, patch)
2015-03-26 08:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 5002: Show all patron categories after insert (2.25 KB, patch)
2015-03-26 08:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 5002: Show all patron categories after insert (2.56 KB, patch)
2015-03-26 09:12 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 5002: Display messages on adding/deleting patron category (8.09 KB, patch)
2015-03-27 14:10 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 5002: Show all patron categories after insert (2.50 KB, patch)
2015-03-27 14:11 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2010-07-14 15:21:10 UTC
When adding new patron categories you can save a new category with an existing category code. 

There is no error message and the new category is not saved.

Koha Version:	3.01.00.142
Comment 1 Paul Poulain 2011-08-02 15:41:55 UTC
still relevant
Comment 2 Katrin Fischer 2013-12-06 00:39:57 UTC
Still valid - Paul, this bug is assigned to you?
Comment 3 Paul Poulain 2013-12-06 07:50:03 UTC
(In reply to Katrin Fischer from comment #2)
> Still valid - Paul, this bug is assigned to you?

Yes, but I can't deal with it, sorry. If someone want it, feel free to take it
Comment 4 Corey 2014-01-14 22:36:51 UTC
Could not resolve the issue, but someone may be able to investigate further and add an IF & ELSE statement in the categorie.pl document (/koha/admin)

In the categorie.pl document, there is an ADD_VALIDATE section that is called by the ADD_FORM, which the rule should be positioned. The IF & ELSE statement should be that IF a category code that the administrator wants to add already exists, then an error message should arise; ELSE, proceed with the new category code.

That should help quite a bit, I gave up... :(
Comment 5 Jonathan Druart 2015-03-24 11:39:49 UTC Comment hidden (obsolete)
Comment 6 Marc Véron 2015-03-25 16:06:46 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2015-03-25 21:01:12 UTC
Hi Jonathan, 

noticed a small problem:
- edit an existing patron category
- save the change
- redirect is to the categories table - but only the edited caegory will show

I think it has something to do with a search parameter - visible in the top search.

Also some suggestions for the messages:
- inserted with success > added successfully
- deleteing > deleting
- Hm, maybe: The patron category might already exist.
Comment 8 Jonathan Druart 2015-03-26 08:31:00 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-03-26 08:32:57 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2015-03-26 08:34:36 UTC
(In reply to Katrin Fischer from comment #7)
> Hi Jonathan, 
> 
> noticed a small problem:
> - edit an existing patron category
> - save the change
> - redirect is to the categories table - but only the edited caegory will show
> 
> I think it has something to do with a search parameter - visible in the top
> search.

I thought it was a feature... :)
I should have tested on master to confirm.

> Also some suggestions for the messages:
> - inserted with success > added successfully
> - deleteing > deleting
> - Hm, maybe: The patron category might already exist.

Fixed.
Comment 11 Marc Véron 2015-03-26 09:12:25 UTC Comment hidden (obsolete)
Comment 12 Kyle M Hall 2015-03-27 14:10:54 UTC
Created attachment 37319 [details] [review]
[PASSED QA] Bug 5002: Display messages on adding/deleting patron category

There are no messages on adding and deleting patron category.
If an error occurs and the data is not inserted, the interface does not
alert the user.

This patch adds a message block to alert the user if something wrong
happened.

Test plan:
1/ Create a patron category PATCAT. You should get a confirmation
message.
2/ Try to create another patron category with the same code. You should
get an error message
3/ Delete the patron category PATCAT. You should get a confirmation
message.

Confirm there is no regression on this form (try update an existing
patron category too).

Followed test plan, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 13 Kyle M Hall 2015-03-27 14:11:00 UTC
Created attachment 37320 [details] [review]
[PASSED QA] Bug 5002: Show all patron categories after insert

+ wording changes.

How I tested:
- edit an existing patron category
- save the change
- redirect is to the categories table - it shows all categories OK

- wording OK as well

Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Tomás Cohen Arazi 2015-03-31 14:01:23 UTC
Patches pushed to master.

Thanks Jonathan!
Comment 15 Chris Cormack 2015-04-02 20:19:42 UTC
Does not apply on 3.18.x, please rebase if you think it is nessecary