From d561e151e5a82ad26c12652860f96bf56cddfeb0 Mon Sep 17 00:00:00 2001 From: Meirza Date: Sat, 23 Sep 2023 18:10:24 +0700 Subject: [PATCH] MDL-78937 lib: Set default value to $component property We encountered errors on the plugin check page while upgrading from version 3.11 to 4.3. The plugins marked with the status "To be deleted" have a null value for the $component property, which results in the following error message: "Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in lib/classes/component.php on line 1056." To avoid this error, we need to set an empty string as the default value for the $component property. --- lib/classes/plugininfo/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/plugininfo/base.php b/lib/classes/plugininfo/base.php index 842ad054db8fb..0ce1b971f5b7a 100644 --- a/lib/classes/plugininfo/base.php +++ b/lib/classes/plugininfo/base.php @@ -84,7 +84,7 @@ abstract class base { public $incompatible; /** @var string Name of the plugin */ - public $component; + public $component = ''; /** * Whether this plugintype supports its plugins being disabled.