@@ -28,6 +28,8 @@ abstract class ActionLogPlugin extends CMSPlugin
2828 *
2929 * @var \Joomla\CMS\Application\CMSApplication
3030 * @since 3.9.0
31+ *
32+ * @deprecated __DEPLOY_VERSION__ will be removed in 7.0 use $this->getApplication() instead
3133 */
3234 protected $ app ;
3335
@@ -36,6 +38,8 @@ abstract class ActionLogPlugin extends CMSPlugin
3638 *
3739 * @var \Joomla\Database\DatabaseDriver
3840 * @since 3.9.0
41+ *
42+ * @deprecated __DEPLOY_VERSION__ will be removed in 7.0 use $this->getDatabase() instead
3943 */
4044 protected $ db ;
4145
@@ -63,7 +67,8 @@ abstract class ActionLogPlugin extends CMSPlugin
6367 */
6468 protected function addLog ($ messages , $ messageLanguageKey , $ context , $ userId = null )
6569 {
66- $ user = $ this ->app ->getIdentity ();
70+ $ app = $ this ->getApplication () ?: $ this ->app ;
71+ $ user = $ app ->getIdentity ();
6772
6873 foreach ($ messages as $ index => $ message ) {
6974 if (!\array_key_exists ('userid ' , $ message )) {
@@ -90,7 +95,7 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu
9095 }
9196
9297 /** @var \Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel $model */
93- $ model = $ this -> app ->bootComponent ('com_actionlogs ' )
98+ $ model = $ app ->bootComponent ('com_actionlogs ' )
9499 ->getMVCFactory ()->createModel ('Actionlog ' , 'Administrator ' , ['ignore_request ' => true ]);
95100
96101 $ model ->addLog ($ messages , strtoupper ($ messageLanguageKey ), $ context , $ userId );
0 commit comments