View | Details | Raw Unified | Return to bug 20930
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (+1 lines)
Lines 213-218 Link Here
213
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
213
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
214
        var MSG_INVALID = _( "Error: presence of invalid data prevents saving. Please make the corrections and try again." );
214
        var MSG_INVALID = _( "Error: presence of invalid data prevents saving. Please make the corrections and try again." );
215
        var MSG_INVALID_SYNTAX = _( "Error: Preference '%s' has invalid syntax" );
215
        var MSG_INVALID_SYNTAX = _( "Error: Preference '%s' has invalid syntax" );
216
        var MSG_INVALID_SYNTAX_LOCATION = _( "Problem found at line %s, column %s." );
216
    </script>
217
    </script>
217
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
218
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
218
    [% Asset.js("js/ajax.js") | $raw %]
219
    [% Asset.js("js/ajax.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-4 / +4 lines)
Lines 56-64 KOHA.Preferences = { Link Here
56
            if (modified_pref in form.sysprefs) {
56
            if (modified_pref in form.sysprefs) {
57
                if (form.sysprefs[modified_pref].error === 'Koha::Exceptions::Config::InvalidSyntax') {
57
                if (form.sysprefs[modified_pref].error === 'Koha::Exceptions::Config::InvalidSyntax') {
58
                    msg += "<strong>"+ MSG_INVALID_SYNTAX.format(modified_pref) + "</strong>\n";
58
                    msg += "<strong>"+ MSG_INVALID_SYNTAX.format(modified_pref) + "</strong>\n";
59
                    var error_message = form.sysprefs[modified_pref].message;
59
                    var location = form.sysprefs[modified_pref].message.match(/line (\d+), column (\d+)/);
60
                    error_message = error_message.replace(/\s+at .* line \d+\.\s+$/, '');
60
                    if (typeof location !== 'undefined' && Array.isArray(location) && location.length===3) {
61
                    msg += error_message;
61
                        msg += "<strong>"+ MSG_INVALID_SYNTAX_LOCATION.format(location[1], location[2]) + "</strong>\n";
62
                    }
62
                } else {
63
                } else {
63
                    msg += "<strong>"+ form.type + "</strong>\n";
64
                    msg += "<strong>"+ form.type + "</strong>\n";
64
                }
65
                }
65
- 

Return to bug 20930