Bug 9529 - Adding a patron shows javascript on screen under login section
Summary: Adding a patron shows javascript on screen under login section
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 9556
  Show dependency treegraph
 
Reported: 2013-02-01 11:16 UTC by Marcel de Rooy
Modified: 2014-05-26 21:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9529 - Adding a patron shows javascript on screen under login section (1.48 KB, patch)
2013-02-06 15:08 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 9529 - Adding a patron shows javascript on screen under login section (1.49 KB, patch)
2013-02-06 15:32 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 9529 - Adding a patron shows javascript on screen under login section (1.56 KB, patch)
2013-02-07 10:56 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2013-02-01 11:16:35 UTC
Add patron shows under login section a html script tag in memberentry_messaging_prefs:

/ *').change(function() { message_prefs_dirty = true; }); $('#categorycode').change(function() { var categorycode = $(this).val(); if (message_prefs_dirty) { if (!confirm('Change messaging preferences to default for this category?')) { return; } } $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode, function(data) { $.each(data.messaging_preferences, function(i, item) { var attrid = item.message_attribute_id; var transports = ['email', 'rss', 'sms']; $.each(transports, function(j, transport) { if (item['transport-' + transport] != ' ') { $('#' + transport + attrid).attr('checked', item['transport-' + transport]); } else { $('#' + transport + attrid).removeAttr('checked'); } }); if (item.digest && item.digest != ' ') { $('#digest' + attrid).attr('checked', item.digest); } else { $('#digest' + attrid).removeAttr('checked'); } if (item.takes_days == '1') { $('[name=' + attrid + '-DAYS]').val('' + item.days_in_advance); } }); message_prefs_dirty = false; } ); }); }); //]]>
Comment 1 Bernardo Gonzalez Kriegel 2013-02-01 12:07:44 UTC
This appears with EnhancedMessagingPreferences set to Allow.
The code is in koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
The JS code can be hidden with <!-- ... -->.
The confirm message needs to be between " (double quotes), can't produce a situation to trigger it. Don't know if this code is used.
Comment 2 Owen Leonard 2013-02-06 15:08:03 UTC Comment hidden (obsolete)
Comment 3 Galen Charlton 2013-02-06 15:32:21 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-02-07 10:56:17 UTC
Created attachment 15130 [details] [review]
Bug 9529 - Adding a patron shows javascript on screen under login section

A typo in my patch for Bug 9265 (HTML5 switch) left an extra quotation
mark in a  <script> tag on the patron entry form, causing JavaScript
code to be output as text instead of interpreted. This patch corrects
it.

To test, apply the patch, enable EnhancedMessagingPreferences, and load
the patron entry form. You should see no JavaScript on screen around
the 'Patron messaging preferences' fieldset.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Jared Camins-Esakov 2013-02-07 12:21:23 UTC
This patch has been pushed to master.