Bugzilla – Attachment 89337 Details for
Bug 22800
No need to raw filter the mandatory fields var (OPAC suggestions)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22800: (bug 22550 follow-up) Do not raw filter when not necessary (OPAC suggestions)
Bug-22800-bug-22550-follow-up-Do-not-raw-filter-wh.patch (text/plain), 2.91 KB, created by
Chris Cormack
on 2019-05-04 07:15:19 UTC
(
hide
)
Description:
Bug 22800: (bug 22550 follow-up) Do not raw filter when not necessary (OPAC suggestions)
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2019-05-04 07:15:19 UTC
Size:
2.91 KB
patch
obsolete
>From 256491e9ef6694c38627c67c1c04470372775301 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 28 Apr 2019 22:09:39 -0400 >Subject: [PATCH] Bug 22800: (bug 22550 follow-up) Do not raw filter when not > necessary (OPAC suggestions) > >This is a follow-up for bug 22550, we do not need to use the $raw >filter. > >Test plan: >Same as bug 22550: >Test plan: >Test plan: >1. OPAC->login->your purchase suggestions->New purchase suggestion >2. Click button "Submit your suggestion" directly without filling in any field. > Empty suggestion record was added succeffully. >3. Apply the patch. >4. Click button "Submit your suggestion" directly without filling in any field. > The required fields should be labeled in red. > (you can change the mandatory fields by preference > 'OPACSuggestionMandatoryFields') > >Signed-off-by: Bin Wen <bin.wen@inlibro.com> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 4 ++-- > opac/opac-suggestions.pl | 6 +++--- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index f560e642b2..5d4e8b8aef 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -339,9 +339,9 @@ > return true; > }); > [% END %] >- [% IF ( op_add && mandatoryfields ) %] >+ [% IF ( op_add && mandatoryfields.size ) %] > { >- var FldsRequired = [[% mandatoryfields | $raw %]]; >+ var FldsRequired = ['[% mandatoryfields.join("','") | html %]']; > for (var i = 0; i < FldsRequired.length; i++) { > var rq_input = $('#' + FldsRequired[i]); > if (rq_input.length != 1) continue; >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index cf562fb97e..b67a475862 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -208,11 +208,11 @@ if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { > $template->param( branchcode => $branchcode ); > } > >-my $mandatoryfields = ''; >+my @mandatoryfields; > { > last unless ($op eq 'add'); > my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title'; >- $mandatoryfields = join(', ', (map { '"'.$_.'"'; } sort split(/\s*\,\s*/, $fldsreq_sp))); >+ @mandatoryfields = sort split(/\s*\,\s*/, $fldsreq_sp); > } > > $template->param( >@@ -224,7 +224,7 @@ $template->param( > messages => \@messages, > suggestionsview => 1, > suggested_by_anyone => $suggested_by_anyone, >- mandatoryfields => $mandatoryfields, >+ mandatoryfields => \@mandatoryfields, > patrons_pending_suggestions_count => $patrons_pending_suggestions_count, > ); > >-- >2.11.0
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 22800
:
88993
|
89325
| 89337