bug PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
30 Aug 2023

Summary of Changes

Addittionaly to #41357 the plugin may set the event result directly $event['result'] = $result.
Example in core Debug plugin

$result = $event['result'] ?: [];
$handler = new OpenHandler($this->debugBar);
$result[] = $handler->handle($this->getApplication()->getInput()->request->getArray(), false, false);
$event['result'] = $result;

But most of our events will be imutable and it will throw an error.
The patch allow to modyfy $event['result'] in ImutableEvent for now, with deprecation waring.

Testing Instructions

Code review.
Also can run:

$event = new class ('onFooBar') extends Joomla\CMS\Event\AbstractImmutableEvent{};
$event['result'] = 'foobar';

Actual result BEFORE applying this Pull Request

An error

Expected result AFTER applying this Pull Request

No error

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org: joomla/Manual#170
  • No documentation changes for manual.joomla.org needed
avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2023
Category Libraries
avatar Fedik Fedik - open - 30 Aug 2023
avatar Fedik Fedik - change - 30 Aug 2023
Status New Pending
avatar Fedik Fedik - change - 30 Aug 2023
Labels Added: bug PR-4.4-dev
avatar HLeithner
HLeithner - comment - 31 Aug 2023

@laoneo @MacJoom I think we need this before beta1

avatar MacJoom MacJoom - change - 31 Aug 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-08-31 21:50:32
Closed_By MacJoom
avatar MacJoom MacJoom - close - 31 Aug 2023
avatar MacJoom MacJoom - merge - 31 Aug 2023
avatar Fedik Fedik - change - 1 Sep 2023
The description was changed
avatar Fedik Fedik - edited - 1 Sep 2023

Add a Comment

Login with GitHub to post a comment