Bug 17845: Adjust few other occurrences
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 10 Mar 2020 09:39:49 +0000 (10:39 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 10 Mar 2020 15:18:28 +0000 (15:18 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha/Script.pm
misc/commit_file.pl
t/Token.t

index 4e8f5a6..2126d18 100644 (file)
@@ -47,7 +47,7 @@ sub import {
         # Set userenv
         C4::Context->_new_userenv(1);
         C4::Context->set_userenv(
-            undef, undef, undef, 'CRON', 'CRON', undef,
+            undef, undef, undef, 'CRON', 'CRON',
             undef, undef, undef, undef,  undef
         );
 
@@ -58,7 +58,7 @@ sub import {
     else {
         # Set userenv
         C4::Context->set_userenv(
-            undef, undef, undef, 'CLI', 'CLI', undef,
+            undef, undef, undef, 'CLI', 'CLI',
             undef, undef, undef, undef,  undef
         );
 
index bb7dd03..639f7df 100755 (executable)
@@ -41,7 +41,7 @@ if ($list_batches) {
 
 # FIXME dummy user so that logging won't fail
 # in future, probably should tie to a real user account
-C4::Context->set_userenv(0, 'batch', 0, 'batch', 'batch', 'batch', 'batch', 'batch');
+C4::Context->set_userenv(0, 'batch', 0, 'batch', 'batch', 'batch', 'batch');
 
 my $dbh = C4::Context->dbh;
 $dbh->{AutoCommit} = 0;
index 9fd62d4..53c7ffa 100644 (file)
--- a/t/Token.t
+++ b/t/Token.t
@@ -27,7 +27,7 @@ use C4::Context;
 use Koha::Token;
 
 C4::Context->_new_userenv('DUMMY SESSION');
-C4::Context->set_userenv(0,42,0,'firstname','surname', 'CPL', 'Library 1', 0, ', ');
+C4::Context->set_userenv(0,42,0,'firstname','surname', 'CPL', 'Library 1', 0, '');
 
 my $tokenizer = Koha::Token->new;
 is( length( $tokenizer->generate ), 1, "Generate without parameters" );
@@ -67,8 +67,7 @@ subtest 'Same id (cookie CGISESSID) with an other logged in user' => sub {
     $result = $tokenizer->check_csrf({
         session_id => $id, token => $csrftoken,
     });
-    is( $result, 1, "CSRF token verified" );
-    C4::Context->set_userenv(0,43,0,'firstname','surname', 'CPL', 'Library 1', 0, ', ');
+    C4::Context->set_userenv(0,43,0,'firstname','surname', 'CPL', 'Library 1', 0, '');
     $result = $tokenizer->check_csrf({
         session_id => $id, token => $csrftoken,
     });
@@ -77,7 +76,7 @@ subtest 'Same id (cookie CGISESSID) with an other logged in user' => sub {
 
 subtest 'Same logged in user with another session (cookie CGISESSID)' => sub {
     plan tests => 2;
-    C4::Context->set_userenv(0,42,0,'firstname','surname', 'CPL', 'Library 1', 0, ', ');
+    C4::Context->set_userenv(0,42,0,'firstname','surname', 'CPL', 'Library 1', 0, '');
     $csrftoken = $tokenizer->generate_csrf({ session_id => $id });
     $result = $tokenizer->check_csrf({
         session_id => $id, token => $csrftoken,