Bug 14070 - Notice not saved when mandatory fields are not filled
Summary: Notice not saved when mandatory fields are not filled
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-28 14:41 UTC by Katrin Fischer
Modified: 2016-12-05 21:23 UTC (History)
3 users (show)

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


Attachments
Bug 14070 Improved handling of Notice saving (3.55 KB, patch)
2015-05-15 14:22 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 14070 Improved handling of Notice saving (4.19 KB, patch)
2015-05-15 19:27 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 14118: Prevent to save a letter if an error occurred (2.16 KB, patch)
2015-05-22 10:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14070: Prevent to save a letter if an error occurred (2.22 KB, patch)
2015-05-22 12:35 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
[PASSED QA] Bug 14070: Prevent to save a letter if an error occurred (2.29 KB, patch)
2015-05-31 20:59 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-04-28 14:41:34 UTC
To test:
- Enter a new text for a notice, don't fill the subject line
- Save - a note is shown that not all mandatory fields have been filled in
- Verify: You are kicked back to the overview page of notices, your changes
  have not been saved 
- Start again...
Comment 1 Indranil Das Gupta 2015-05-15 06:06:43 UTC
(In reply to Katrin Fischer from comment #0)
> To test:
> - Enter a new text for a notice, don't fill the subject line
> - Save - a note is shown that not all mandatory fields have been filled in
> - Verify: You are kicked back to the overview page of notices, your changes
>   have not been saved 
> - Start again...

I found another issue too - the same issue affected during edits too. Example: You had mail and print filled in. Now you want to edit print, but accidentally managed to delete one of the fields in the mail fieldset. Koha would allow you to save the record, but in the process knocked off the rest of the mail fieldset data.

Wrote a small patch. Uploading in a few.

-idg
Comment 2 Indranil Das Gupta 2015-05-15 14:22:14 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2015-05-15 19:27:02 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-05-22 10:02:55 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2015-05-22 10:03:47 UTC
Indranil, could you please have a look at my counter patch?
I am not sure to understand why you patch is so complex :)
Comment 6 Indranil Das Gupta 2015-05-22 11:00:22 UTC
(In reply to Jonathan Druart from comment #5)
> Indranil, could you please have a look at my counter patch?
> I am not sure to understand why you patch is so complex :)

Jonathan: your patch is better and cleaner. I agree we should 
run with this.
Comment 7 Jonathan Druart 2015-05-22 12:04:35 UTC
(In reply to Indranil Das Gupta from comment #6)
> (In reply to Jonathan Druart from comment #5)
> > Indranil, could you please have a look at my counter patch?
> > I am not sure to understand why you patch is so complex :)
> 
> Jonathan: your patch is better and cleaner. I agree we should 
> run with this.

Great, I obsolete yours.
Comment 8 Indranil Das Gupta 2015-05-22 12:31:04 UTC
(In reply to Jonathan Druart from comment #7)
> (In reply to Indranil Das Gupta from comment #6)
> > (In reply to Jonathan Druart from comment #5)
> > > Indranil, could you please have a look at my counter patch?
> > > I am not sure to understand why you patch is so complex :)
> > 
> > Jonathan: your patch is better and cleaner. I agree we should 
> > run with this.
> 
> Great, I obsolete yours.

Could you please update the commit message with the correct bug id? thanks :)
Comment 9 Indranil Das Gupta 2015-05-22 12:35:47 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2015-05-31 20:59:31 UTC
Created attachment 39721 [details] [review]
[PASSED QA] Bug 14070: Prevent to save a letter if an error occurred

On saving a letter, if the title or the content of a template is not
defined, a JS alert is raised. But the form is submitted anyway.
This patch prevent the form to be submitted.

Test plan:
- Create or edit a letter
- Fill the title for a template, not the content
- Save
- Confirm you get the alert and that the form is not submitted

http://bugs.koha-community.org/show_bug.cgi?id=14070

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2015-05-31 20:59:53 UTC
Much less annoying, thx!
Comment 12 Tomás Cohen Arazi (tcohen) 2015-06-17 12:58:13 UTC
Patch pushed to master.

Thanks Jonathan!