diff --git a/libraries/src/Event/AbstractImmutableEvent.php b/libraries/src/Event/AbstractImmutableEvent.php index bfbf6691658a4..e0d2aba979d34 100644 --- a/libraries/src/Event/AbstractImmutableEvent.php +++ b/libraries/src/Event/AbstractImmutableEvent.php @@ -64,6 +64,18 @@ public function __construct(string $name, array $arguments = []) */ public function offsetSet($name, $value) { + // B/C check for plugins which use $event['result'] = $result; + if ($name === 'result') { + parent::offsetSet($name, $value); + + @trigger_error( + 'Setting a result in an immutable event is deprecated, and will not work in Joomla 6. Event ' . $this->getName(), + E_USER_DEPRECATED + ); + + return; + } + throw new \BadMethodCallException( sprintf( 'Cannot set the argument %s of the immutable event %s.',