fix PHP 8.0 error: Api\Vfs::lock(): Argument #5 ($scope) cannot be passed by reference

This commit is contained in:
Ralf Becker 2021-10-05 12:01:16 +02:00
parent 357fefaad0
commit e2ac0ab7b6

View File

@ -1739,9 +1739,11 @@ class calendar_uiforms extends calendar_ui
$lock_path = Vfs::app_entry_lock_path('calendar',$event['id']); $lock_path = Vfs::app_entry_lock_path('calendar',$event['id']);
$lock_owner = 'mailto:'.$GLOBALS['egw_info']['user']['account_email']; $lock_owner = 'mailto:'.$GLOBALS['egw_info']['user']['account_email'];
$scope = 'shared';
$type = 'write';
if (($preserv['lock_token'] = $event['lock_token'])) // already locked --> refresh the lock if (($preserv['lock_token'] = $event['lock_token'])) // already locked --> refresh the lock
{ {
Vfs::lock($lock_path,$preserv['lock_token'],$locktime,$lock_owner,$scope='shared',$type='write',true,false); Vfs::lock($lock_path,$preserv['lock_token'],$locktime,$lock_owner,$scope,$type,true,false);
} }
if (($lock = Vfs::checkLock($lock_path)) && $lock['owner'] != $lock_owner) if (($lock = Vfs::checkLock($lock_path)) && $lock['owner'] != $lock_owner)
{ {
@ -1753,7 +1755,7 @@ class calendar_uiforms extends calendar_ui
{ {
$preserv['lock_token'] = $lock['token']; $preserv['lock_token'] = $lock['token'];
} }
elseif(Vfs::lock($lock_path,$preserv['lock_token'],$locktime,$lock_owner,$scope='shared',$type='write',false,false)) elseif(Vfs::lock($lock_path,$preserv['lock_token'],$locktime,$lock_owner,$scope,$type,false,false))
{ {
//We handle AJAX_REQUEST in client-side for unlocking the locked entry, in case of closing the entry by X button or close button //We handle AJAX_REQUEST in client-side for unlocking the locked entry, in case of closing the entry by X button or close button
} }