Created attachment 103057 [details] 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.
Created attachment 103058 [details] but in opac, fields not mandatory and can save a blank form
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?
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
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.
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.
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.
(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.
Created attachment 103872 [details] jQuery v1.7.2 The jquery used in this koha version is jQuery v1.7.2. Is your koha using the same version?
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)
(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?
(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
Created attachment 104468 [details] opac-sugestions.pl only has 232 lines (but console state the error line is 1118)
The HTML source of the page.
Created attachment 105653 [details] HTML Source code
(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?
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 %]'];
(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.
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.