Summary: | It should not be possible to store empty news | ||
---|---|---|---|
Product: | Koha | Reporter: | Marc Véron <veron> |
Component: | Tools | Assignee: | Galen Charlton <gmcharlt> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Screenshot of empty news in staff and OPAC
Bug 12740 - It should not be possible to store empty news Bug 12740 - It should not be possible to store empty news [SIGNED OFF] Bug 12740 - It should not be possible to store empty news Bug 12740 - Data Validation followup [Signed-off] Bug 12740 - Data Validation followup Bug 12740 - It should not be possible to store empty news Bug 12740 - Data Validation followup Bug 12740: Make the error message translatable |
Created attachment 31579 [details] [review] Bug 12740 - It should not be possible to store empty news This patch marks the title field and the textarea field as 'required' and it is not longer possible to store a news without having at least a title. Note: The 'required' validation for a textarea does not work properly, that's why the textarea for the news text is not validated, only marked as 'required' To test: Got to Tools->News Create news or edit existing news Fields "Title" and "News" should have a red label and should be marked as "required" It should not be possible to save with empty field "Title" I like this, it works as expected, but I wonder why the fields 'News' is marked as required since it actually isn't being required? I actually think title only news is a good feature for short announcements. Created attachment 31788 [details] [review] Bug 12740 - It should not be possible to store empty news This patch marks the title field as 'required' and it is not longer possible to store a news without having at least a title. To test: Got to Tools->News Create news or edit existing news Field "Title" should have a red label and should be marked as "required" It should not be possible to save with empty field "Title" Created attachment 31789 [details] [review] [SIGNED OFF] Bug 12740 - It should not be possible to store empty news This patch marks the title field as 'required' and it is not longer possible to store a news without having at least a title. To test: Got to Tools->News Create news or edit existing news Field "Title" should have a red label and should be marked as "required" It should not be possible to save with empty field "Title" Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: Only keeps the user from doing it. Fails to handle the fake the url call case. https://demo.library-admin.kohasystem.ca/cgi-bin/koha/tools/koha-news.pl?op=add&lang=&branch=&title=&from=&to=&number=&new= Created attachment 31790 [details] [review] Bug 12740 - Data Validation followup Added server-side validation and feedback to Koha news. TEST PLAN --------- 1) Log in to staff client as someone who can add news 2) Paste a variation of the ugly following URL into your address bar: https://demo.library-admin.kohasystem.ca/cgi-bin/koha/tools/koha-news.pl?op=add&lang=&branch=&title=&from=&to=&number=&new= -- A blank news item is added without warning! 3) Apply patch 4) Repeat step 2 -- "ERROR: Required news title missing!" is displayed and no blank news is added 5) run koha qa test tools Created attachment 31791 [details] [review] [Signed-off] Bug 12740 - Data Validation followup Added server-side validation and feedback to Koha news. TEST PLAN --------- 1) Log in to staff client as someone who can add news 2) Paste a variation of the ugly following URL into your address bar: https://demo.library-admin.kohasystem.ca/cgi-bin/koha/tools/koha-news.pl?op=add&lang=&branch=&title=&from=&to=&number=&new= -- A blank news item is added without warning! 3) Apply patch 4) Repeat step 2 -- "ERROR: Required news title missing!" is displayed and no blank news is added 5) run koha qa test tools Followed test plan, Error message appears as expected, qa test tool: OK Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 31804 [details] [review] Bug 12740 - It should not be possible to store empty news This patch marks the title field as 'required' and it is not longer possible to store a news without having at least a title. To test: Got to Tools->News Create news or edit existing news Field "Title" should have a red label and should be marked as "required" It should not be possible to save with empty field "Title" Signed-off-by: Mark Tompsett <mtompset@hotmail.com> NOTE: Only keeps the user from doing it. Fails to handle the fake the url call case. https://demo.library-admin.kohasystem.ca/cgi-bin/koha/tools/koha-news.pl?op=add&lang=&branch=&title=&from=&to=&number=&new= Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 31805 [details] [review] Bug 12740 - Data Validation followup Added server-side validation and feedback to Koha news. TEST PLAN --------- 1) Log in to staff client as someone who can add news 2) Paste a variation of the ugly following URL into your address bar: https://demo.library-admin.kohasystem.ca/cgi-bin/koha/tools/koha-news.pl?op=add&lang=&branch=&title=&from=&to=&number=&new= -- A blank news item is added without warning! 3) Apply patch 4) Repeat step 2 -- "ERROR: Required news title missing!" is displayed and no blank news is added 5) run koha qa test tools Followed test plan, Error message appears as expected, qa test tool: OK Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 31806 [details] [review] Bug 12740: Make the error message translatable Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Patches pushed to master. Thanks Marc! |
Created attachment 30647 [details] Screenshot of empty news in staff and OPAC To reproduce: In staff client go to Tools->News Click 'New entry' Click 'Submit' Result: News without title an text is stored without warning and is displayed for all libraries in staff client, OPAC and on slips.