Bugzilla – Attachment 134986 Details for
Bug 24010
Number of issues to display to staff accepts non-integer values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24010: Number of issues to display to staff accepts non-integer values
Bug-24010-Number-of-issues-to-display-to-staff-acc.patch (text/plain), 4.09 KB, created by
Owen Leonard
on 2022-05-13 17:22:00 UTC
(
hide
)
Description:
Bug 24010: Number of issues to display to staff accepts non-integer values
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-05-13 17:22:00 UTC
Size:
4.09 KB
patch
obsolete
>From 31503796e8bb7967a9baddac7453bc7c2b3a1345 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 13 May 2022 15:14:26 +0000 >Subject: [PATCH] Bug 24010: Number of issues to display to staff accepts > non-integer values > >This patch modifies the subscription entry form so that it will perform >a check on the staffdisplaycount and opacdisplaycount fields before >proceding to the second step. It verifies that the values are numeric. > >The changes are made in the style of the existing form validation, which >should be rewritten to either use the validation plugin or to peform >checks in a way that all checks are run before warning the user. >However, this smaller change will work in the meantime. > >To test, apply the patch and go to Serials -> New subscription. > >- Fill out the form with at least the required fields, but put something > other than a number if the "Number of issues to display to staff" and > "Number of issues to display to the public" with non-numeric characters. >- When you click the "Next" button you should get an error message, > "Number of issues to display to staff must be a number." >- Correct the issues to display to staff field and submit again. >- You should get a different error message, "Number of issues to display > to the public must be a number." >- Correct this field and you should be able to proceed to the next step. >--- > .../prog/en/modules/serials/subscription-add.tt | 4 ++-- > .../intranet-tmpl/prog/js/subscription-add.js | 17 +++++++++++++++-- > 2 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 53760cf4fb..74eafacd8c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -246,11 +246,11 @@ fieldset.rows table { clear: none; margin: 0; } > </li> > <li> > <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label> >- <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount | html %]" size="4"/> >+ <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount | html %]" inputmode="numeric" pattern="[0-9]*" size="4"/> > </li> > <li> > <label class="widelabel" for="opacdisplaycount">Number of issues to display to the public: </label> >- <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount | html %]" size="4"/> >+ <input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount | html %]" inputmode="numeric" pattern="[0-9]*" size="4"/> > </li> > </ol> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >index 557b5b18a7..c0938ef035 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >@@ -68,8 +68,21 @@ function Check_page1() { > > var bib_exists = $("input[name='title']").val().length; > >- if (!bib_exists) alert( __("Bibliographic record does not exist!") ); >- return bib_exists; >+ if (!bib_exists){ >+ alert( __("Bibliographic record does not exist!") ); >+ return false; >+ } >+ >+ if( isNaN( $("#staffdisplaycount").val() ) ){ >+ alert( __("Number of issues to display to staff must be a number") ); >+ return false; >+ } >+ if( isNaN( $("#opacdisplaycount").val() ) ){ >+ alert( __("Number of issues to display to the public must be a number") ); >+ return false; >+ } else { >+ return true; >+ } > } > > function Check_page2(){ >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24010
:
95610
|
95717
|
95718
|
95847
|
95935
|
134985
|
134986
|
135092
|
136538
|
136539
|
137060
|
137062
|
137175