Feature PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
6 Aug 2023

Summary of Changes

Implementing Event classes for Application configuration events.
This also need #41226, that has some fixes. But can be tested without.

Affected events:

  • onApplicationBeforeSave
  • onApplicationAfterSave

Testing Instructions

Apply patch.
Try edit global configuration.
All should work as before.

Actual result BEFORE applying this Pull Request

Works

Expected result AFTER applying this Pull Request

Works

Link to documentations

Please select:

avatar joomla-cms-bot joomla-cms-bot - change - 6 Aug 2023
Category Administration com_config Libraries
avatar Fedik Fedik - open - 6 Aug 2023
avatar Fedik Fedik - change - 6 Aug 2023
Status New Pending
avatar heelc29
heelc29 - comment - 6 Aug 2023

There is a small b/c break
image

- $result = $app->triggerEvent('onApplicationBeforeSave', [$config]);
+ $result = $app->triggerEvent('onApplicationBeforeSave', ['subject' => $config]);

image

- $app->triggerEvent('onApplicationAfterSave', [$config]);
+ $app->triggerEvent('onApplicationAfterSave', ['subject' => $config]);

you will see it when you perform removeroot

public function removeroot()
{
$app = Factory::getApplication();
// Get the previous configuration.
$prev = new \JConfig();
$prev = ArrayHelper::fromObject($prev);
// Create the new configuration object, and unset the root_user property
unset($prev['root_user']);
$config = new Registry($prev);
$result = $app->triggerEvent('onApplicationBeforeSave', [$config]);
// Store the data.
if (in_array(false, $result, true)) {
throw new \RuntimeException(Text::_('COM_CONFIG_ERROR_UNKNOWN_BEFORE_SAVING'));
}
// Write the configuration file.
$result = $this->writeConfigFile($config);
// Trigger the after save event.
$app->triggerEvent('onApplicationAfterSave', [$config]);
return $result;
}

avatar heelc29 heelc29 - test_item - 6 Aug 2023 - Tested unsuccessfully
avatar heelc29
heelc29 - comment - 6 Aug 2023

I have tested this item ? unsuccessfully on 63854ec

See comments above


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41325.

avatar Fedik Fedik - change - 6 Aug 2023
Labels Added: Feature PR-5.0-dev
avatar Fedik
Fedik - comment - 6 Aug 2023

Yea, I have missed couple ones, should be good now

avatar heelc29 heelc29 - test_item - 6 Aug 2023 - Tested successfully
avatar heelc29
heelc29 - comment - 6 Aug 2023

I have tested this item successfully on bb8986c

Looks good now. Thanks


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41325.

avatar HLeithner
HLeithner - comment - 20 Aug 2023

Merging this for the next alpha to get more feedback. Thanks for the work.

avatar HLeithner HLeithner - change - 21 Aug 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-08-21 08:22:22
Closed_By HLeithner
avatar HLeithner HLeithner - close - 21 Aug 2023
avatar HLeithner HLeithner - merge - 21 Aug 2023
avatar HLeithner
HLeithner - comment - 21 Aug 2023

thanks

Add a Comment

Login with GitHub to post a comment