Bugzilla – Attachment 191559 Details for
Bug 41060
Add a value_builder to check if ISSN is valid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41060: (QA follow-up) Check in change, trigger once in Blur
Bug-41060-QA-follow-up-Check-in-change-trigger-onc.patch (text/plain), 3.23 KB, created by
Marcel de Rooy
on 2026-01-16 10:40:05 UTC
(
hide
)
Description:
Bug 41060: (QA follow-up) Check in change, trigger once in Blur
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2026-01-16 10:40:05 UTC
Size:
3.23 KB
patch
obsolete
>From 520e9208847ae259cc886301cf754b0a12928d4f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 16 Jan 2026 09:30:14 +0100 >Subject: [PATCH] Bug 41060: (QA follow-up) Check in change, trigger once in > Blur >Content-Type: text/plain; charset=utf-8 > >If we already checked and nothing changes, no need to check again. >Set focus to field if we warn. >For consistency copied these changes to validate_isbn. > >Test plan: >Try various valid and invalid ISSNs. >Tab through the field repeatedly; you should only have a warning >once, if the ISSN is invalid (yellow colored). >Save a bad ISSN into a record. Open it again and tab through ISSN; >you should be warned. > >Repeat similarly for ISBN field. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > cataloguing/value_builder/validate_isbn.pl | 14 ++++++++++---- > cataloguing/value_builder/validate_issn.pl | 14 ++++++++++---- > 2 files changed, 20 insertions(+), 8 deletions(-) > >diff --git a/cataloguing/value_builder/validate_isbn.pl b/cataloguing/value_builder/validate_isbn.pl >index 5e51a49576..4bc977e239 100755 >--- a/cataloguing/value_builder/validate_isbn.pl >+++ b/cataloguing/value_builder/validate_isbn.pl >@@ -30,20 +30,26 @@ my $builder = sub { > > return qq| > <script> >-function Blur$id(event) { >+function Change$id(event) { > field = \$('#'+event.data.id); > isbn = field.val(); > var url = '../cataloguing/plugin_launcher.pl?plugin_name=validate_isbn.pl&isbn=' + isbn; > var req = \$.get(url); > req.done(function(resp){ >- if ( resp != 1 ) { >+ field.addClass("checked_isbn"); >+ if ( resp == 1 ) field.removeClass("subfield_not_filled"); >+ else { > field.addClass("subfield_not_filled"); >+ field.focus(); > alert("Invalid ISBN : " + isbn); >- return; > } >- field.removeClass("subfield_not_filled"); > }); > } >+function Blur$id(event) { >+ field = \$('#'+event.data.id); >+ // when not yet checked (in existing record), trigger change event >+ if ( !field.hasClass("checked_isbn") ) field.trigger("change"); >+} > </script>|; > }; > >diff --git a/cataloguing/value_builder/validate_issn.pl b/cataloguing/value_builder/validate_issn.pl >index 164af3ef16..ad712bc572 100755 >--- a/cataloguing/value_builder/validate_issn.pl >+++ b/cataloguing/value_builder/validate_issn.pl >@@ -30,20 +30,26 @@ my $builder = sub { > > return qq| > <script> >-function Blur$id(event) { >+function Change$id(event) { > field = \$('#'+event.data.id); > issn = field.val(); > var url = '../cataloguing/plugin_launcher.pl?plugin_name=validate_issn.pl&issn=' + issn; > var req = \$.get(url); > req.done(function(resp){ >- if ( resp != 1 ) { >+ field.addClass("checked_issn"); >+ if ( resp == 1 ) field.removeClass("subfield_not_filled"); >+ else { > field.addClass("subfield_not_filled"); >+ field.focus(); > alert("Invalid ISSN : " + issn); >- return; > } >- field.removeClass("subfield_not_filled"); > }); > } >+function Blur$id(event) { >+ field = \$('#'+event.data.id); >+ // when not yet checked (in existing record), trigger change event >+ if ( !field.hasClass("checked_issn") ) field.trigger("change"); >+} > </script>|; > }; > >-- >2.39.5
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 41060
:
188200
|
188418
|
190929
|
190930
|
190943
|
190944
|
191557
|
191558
| 191559 |
191560