Bug 26019: Koha should set SameSite attribute on cookies
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / includes / cateditor-ui.inc
index 822f984..9fd3364 100644 (file)
@@ -319,7 +319,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
                         recname = 'record-'+controlnumfield.subfield('@')+'.xml';
                     }
                 [% END %]
-                saveAs( new Blob( [record.toXML()], { 'type': 'application/octe     t-stream;charset=utf-8' } ), recname );
+                saveAs( new Blob( [record.toXML()], { 'type': 'application/octet-stream;charset=utf-8' } ), recname );
 
                 done( {} );
             }
@@ -902,7 +902,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
                 })
             };
             $.ajax(options)
-                .then(function(undef, result) {
+                .then(function(result) {
                     showSavedMacros();
                     loadMacro( result.name, result.macro_id );
                 })
@@ -1207,7 +1207,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
         $( '#switch-editor' ).click( function() {
             if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
 
-            $.cookie( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'basic', { expires: 365, path: '/' } );
+            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} );
 
             if ( state.backend == 'catalog' ) {
                 window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;