[Bug 25168] New: mandatory field has been set in admin but purchase suggestion (in opac) allow to enter null value
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 Bug ID: 25168 Summary: mandatory field has been set in admin but purchase suggestion (in opac) allow to enter null value Change sponsored?: --- Product: Koha Version: 18.11 Hardware: All OS: Linux Status: NEW Severity: major Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: hamsiah@interxs.com.my QA Contact: testopia@bugs.koha-community.org Created attachment 103057 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103057&action=edit mandatory fields are set in admin module Hi, We have set the mandatory fields needed for purchase administration. However, when user open the purchase suggestions form in OPAC, user can leave the mandatory fields blank instead of prompt the fields should not be empty. Kindly refer attachment for details view. Thank you. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #1 from ciarebaha <hamsiah@interxs.com.my> --- Created attachment 103058 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103058&action=edit but in opac, fields not mandatory and can save a blank form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 ciarebaha <hamsiah@interxs.com.my> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hamsiah@interxs.com.my -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- OS|Linux |All --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- I cannot reproduce this problem in 18.11.x using Firefox or Chrome. Can you confirm your Koha version and the browser you're using? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #3 from ciarebaha <hamsiah@interxs.com.my> --- Thank you for your response. I'm using Google Chrome - Version 81.0.4044.113 on macbook. I also tested on mozilla firefox & safari but still got the same problem. The Koha version is 18.11.13.000 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I have tested on 18.11.13 (and master) and it seems to work correctly, with the exact values you selected. Could you open the console (ctrl+shift+c, then "console" tab) then refresh the page. Maybe you have a JS error that prevents the validation of the form. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I first thought this could be Bug 22550 - OPAC suggestion form doesn't require mandatory fields, but this is in 18.11 I have also checked that it works on our 18.11.11. I agree with Jonathan that a JS error is a likely candidate for causing this issue. If you have anything in OpacUserJS try emptying out the preference and see if that would fix your issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #6 from ciarebaha <hamsiah@interxs.com.my> --- Created attachment 103869 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103869&action=edit Uncaught ReferenceError: ARRAY is not defined Yes, it seems like the cause came from the JS/.pl script. I've been searching for the problem but unfortunately still could not find it. Actually this problem happen only on the production server. On the development server, it works perfectly fine even though the source code exactly the same. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #7 from ciarebaha <hamsiah@interxs.com.my> --- (In reply to Katrin Fischer from comment #5)
I first thought this could be Bug 22550 - OPAC suggestion form doesn't require mandatory fields, but this is in 18.11
I have also checked that it works on our 18.11.11.
I agree with Jonathan that a JS error is a likely candidate for causing this issue. If you have anything in OpacUserJS try emptying out the preference and see if that would fix your issue.
I already tried to empty the OpacUserJS but seems like its not the cause of the problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #8 from ciarebaha <hamsiah@interxs.com.my> --- Created attachment 103872 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103872&action=edit jQuery v1.7.2 The jquery used in this koha version is jQuery v1.7.2. Is your koha using the same version? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- We package the jQuery libraries - they should always be the same for everony on a specific Koha version. Which is your exact 18.11.x verson? (what's the x? you can find the information on the about page) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to ciarebaha from comment #6)
Created attachment 103869 [details] Uncaught ReferenceError: ARRAY is not defined
Yes, it seems like the cause came from the JS/.pl script. I've been searching for the problem but unfortunately still could not find it. Actually this problem happen only on the production server. On the development server, it works perfectly fine even though the source code exactly the same.
What is line 1118 in the code source of the page? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #11 from ciarebaha <hamsiah@interxs.com.my> --- (In reply to Jonathan Druart from comment #10)
(In reply to ciarebaha from comment #6)
Created attachment 103869 [details] Uncaught ReferenceError: ARRAY is not defined
Yes, it seems like the cause came from the JS/.pl script. I've been searching for the problem but unfortunately still could not find it. Actually this problem happen only on the production server. On the development server, it works perfectly fine even though the source code exactly the same.
What is line 1118 in the code source of the page?
line 1118 is not exist because in file opac-suggestions.pl only has 232 lines in the source code file. this is normal because opac-suggestions.pl include multiple files in it. hence to find the exactly line number 1118 is quite hard. :( i will attach the opac-suggestions.pl screenshot on comment area below -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #12 from ciarebaha <hamsiah@interxs.com.my> --- Created attachment 104468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104468&action=edit opac-sugestions.pl only has 232 lines (but console state the error line is 1118) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The HTML source of the page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #14 from ciarebaha <hamsiah@interxs.com.my> --- Created attachment 105653 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105653&action=edit HTML Source code -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #15 from ciarebaha <hamsiah@interxs.com.my> --- (In reply to Jonathan Druart from comment #13)
The HTML source of the page.
I have attached the html code (downloaded directly from page). Please refer line 1118. It seems like the variable does not carry array value. What possibly is the cause? And how can i check? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The problematic line is: 1118 var FldsRequired = [ARRAY(0x66dd688)]; Can you open your file opac-suggestions.tt and copy what you have line 346 please? It must be 346 var FldsRequired = ['[% mandatoryfields.join("','") | html %]']; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 ciarebaha <hamsiah@interxs.com.my> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #17 from ciarebaha <hamsiah@interxs.com.my> --- (In reply to Jonathan Druart from comment #16)
The problematic line is:
1118 var FldsRequired = [ARRAY(0x66dd688)];
Can you open your file opac-suggestions.tt and copy what you have line 346 please?
It must be
346 var FldsRequired = ['[% mandatoryfields.join("','") | html %]'];
The purchase suggestion already working now after we add .join (",") to opac.suggestion.tt. Thank you all. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25168 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This is the exact line that exists in 18.11.13 You should not edit your file manually, consider an upgrade instead. And, next time you open a bug report, please make sure you report the correct Koha version number! You can find it on the about page. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org