From 3701931c2167835c565835f6c820da44c5521b75 Mon Sep 17 00:00:00 2001 From: mutesplash Date: Thu, 21 Mar 2024 12:58:18 +0000 Subject: [PATCH 1/2] Fixes warning similar to to 27ff697d --- inc/ui/collection-edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php index ced4f4e2..30bd1cd7 100644 --- a/inc/ui/collection-edit.php +++ b/inc/ui/collection-edit.php @@ -380,7 +380,7 @@ if ( $editor->Available() ) { $submit_label = translate('Apply Changes'); } - $grant_privileges = bindec($grantrow->Value('grant_privileges')); + $grant_privileges = isset($grantrow->Value('grant_privileges')) ? bindec($grantrow->Value('grant_privileges')) : 0; $privileges_set = '
'; for( $i=0; $i < count($privilege_names); $i++ ) { $privilege_set = ( (1 << $i) & $grant_privileges ? ' CHECKED' : ''); From 237fda57b0aa7fbcff4cf90aa27db287d4f02cc4 Mon Sep 17 00:00:00 2001 From: mutesplash Date: Tue, 16 Apr 2024 19:29:18 +0000 Subject: [PATCH 2/2] Actually set a variable before checking isset() --- inc/ui/collection-edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php index 30bd1cd7..17bbbe9c 100644 --- a/inc/ui/collection-edit.php +++ b/inc/ui/collection-edit.php @@ -380,7 +380,8 @@ if ( $editor->Available() ) { $submit_label = translate('Apply Changes'); } - $grant_privileges = isset($grantrow->Value('grant_privileges')) ? bindec($grantrow->Value('grant_privileges')) : 0; + $gp_temp = $grantrow->Value('grant_privileges') + $grant_privileges = isset($gp_temp) ? bindec($gp_temp) : 0; $privileges_set = '
'; for( $i=0; $i < count($privilege_names); $i++ ) { $privilege_set = ( (1 << $i) & $grant_privileges ? ' CHECKED' : '');