From 2d8dbcc635f0d1c77bfbe642cead969198cd465b Mon Sep 17 00:00:00 2001 From: sarfaraz-buddyboss Date: Mon, 24 Aug 2026 18:39:23 +0530 Subject: [PATCH] Fix code to avoid Uncaught ValueError --- src/bp-core/bp-core-functions.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/bp-core/bp-core-functions.php b/src/bp-core/bp-core-functions.php index 3a2205ca1a..cc31e47b67 100644 --- a/src/bp-core/bp-core-functions.php +++ b/src/bp-core/bp-core-functions.php @@ -7660,8 +7660,18 @@ function bb_get_modern_notification_admin_settings_is_enabled( $notification_key } $default_enabled_notifications = array_column( $options['fields'], 'default', 'key' ); - $enabled_notification = array_filter( array_combine( array_keys( $enabled_all_notification ), array_column( $enabled_all_notification, 'main' ) ) ); - $enabled_notification = array_merge( $default_enabled_notifications, $enabled_notification ); + // Safely build the enabled_notification map + $enabled_notification = array(); + if ( ! empty( $enabled_all_notification ) && is_array( $enabled_all_notification ) ) { + foreach ( $enabled_all_notification as $key => $value ) { + if ( is_array( $value ) && isset( $value['main'] ) ) { + $enabled_notification[ $key ] = $value['main']; + } + } + } + + $enabled_notification = array_filter( $enabled_notification ); + $enabled_notification = array_merge( $default_enabled_notifications, $enabled_notification ); $fields = array_filter( $options['fields'],