Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ abstract class ActionLogPlugin extends CMSPlugin
*
* @var \Joomla\CMS\Application\CMSApplication
* @since 3.9.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0 use $this->getApplication() instead
*/
protected $app;

Expand All @@ -36,6 +38,8 @@ abstract class ActionLogPlugin extends CMSPlugin
*
* @var \Joomla\Database\DatabaseDriver
* @since 3.9.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0 use $this->getDatabase() instead
*/
protected $db;

Expand Down Expand Up @@ -63,7 +67,8 @@ abstract class ActionLogPlugin extends CMSPlugin
*/
protected function addLog($messages, $messageLanguageKey, $context, $userId = null)
{
$user = $this->app->getIdentity();
$app = $this->getApplication();
$user = $app->getIdentity();

foreach ($messages as $index => $message) {
if (!\array_key_exists('userid', $message)) {
Expand All @@ -90,7 +95,7 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu
}

/** @var \Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel $model */
$model = $this->app->bootComponent('com_actionlogs')
$model = $app->bootComponent('com_actionlogs')
->getMVCFactory()->createModel('Actionlog', 'Administrator', ['ignore_request' => true]);

$model->addLog($messages, strtoupper($messageLanguageKey), $context, $userId);
Expand Down