Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -13,7 +13,6 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel;

/**
* Abstract Action Log Plugin
Expand Down Expand Up @@ -94,8 +93,10 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu
$messages[$index] = $message;
}

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

$model->addLog($messages, strtoupper($messageLanguageKey), $context, $userId);
}
}
4 changes: 3 additions & 1 deletion administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -7231,7 +7231,9 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
*/
private function cleanJoomlaCache()
{
$model = new \Joomla\Component\Cache\Administrator\Model\CacheModel;
/** @var \Joomla\Component\Cache\Administrator\Model\CacheModel $model */
$model = Factory::getApplication()->bootComponent('com_cache')->getMVCFactory()
->createModel('Cache', 'Administrator', ['ignore_request' => true]);

// Clean frontend cache
$model->clean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogsModel;
use Joomla\Registry\Registry;

/**
Expand All @@ -36,8 +36,9 @@ abstract class LatestActionsHelper
*/
public static function getList(&$params)
{
/** @var ActionlogsModel $model */
$model = new ActionlogsModel(['ignore_request' => true]);
/** @var \Joomla\Component\Actionlogs\Administrator\Model\ActionlogsModel $model */
$model = Factory::getApplication()->bootComponent('com_actionlogs')->getMVCFactory()
->createModel('Actionlogs', 'Administrator', ['ignore_request' => true]);

// Set the Start and Limit
$model->setState('list.start', 0);
Expand Down
6 changes: 4 additions & 2 deletions administrator/modules/mod_messages/mod_messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
// Try to get the items from the messages model
try
{
$messagesModel = new \Joomla\Component\Messages\Administrator\Model\MessagesModel(['ignore_request' => true]);
/** @var \Joomla\Component\Messages\Administrator\Model\MessagesModel $messagesModel */
$messagesModel = $app->bootComponent('com_messages')->getMVCFactory()
->createModel('Messages', 'Administrator', ['ignore_request' => true]);
$messagesModel->setState('filter.state', 0);
$messages = $messagesModel->getItems();
$messages = $messagesModel->getItems();
}
catch (RuntimeException $e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
// Try to get the items from the post-installation model
try
{
$messagesModel = new \Joomla\Component\Postinstall\Administrator\Model\MessagesModel(['ignore_request' => true]);
/** @var \Joomla\Component\Postinstall\Administrator\Model\MessagesModel $messagesModel */
$messagesModel = $app->bootComponent('com_postinstall')->getMVCFactory()
->createModel('Messages', 'Administrator', ['ignore_request' => true]);
$messages = $messagesModel->getItems();
}
catch (RuntimeException $e)
Expand Down
4 changes: 3 additions & 1 deletion components/com_contact/src/View/Contact/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public function display($tpl = null)
if ($item && $item->params->get('show_contact_list'))
{
// Get Category Model data
$categoryModel = new \Joomla\Component\Contact\Site\Model\CategoryModel(array('ignore_request' => true));
/** @var \Joomla\Component\Contact\Site\Model\CategoryModel $categoryModel */
$categoryModel = $app->bootComponent('com_contact')->getMVCFactory()
->createModel('Category', 'Site', ['ignore_request' => true]);

$categoryModel->setState('category.id', $item->catid);
$categoryModel->setState('list.ordering', 'a.name');
Expand Down
5 changes: 3 additions & 2 deletions plugins/content/joomla/joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\Table\CoreContent;
use Joomla\CMS\User\User;
use Joomla\CMS\Workflow\WorkflowServiceInterface;
use Joomla\Component\Workflow\Administrator\Model\StagesModel;
use Joomla\Component\Workflow\Administrator\Table\StageTable;
use Joomla\Component\Workflow\Administrator\Table\WorkflowTable;
use Joomla\Database\DatabaseDriver;
Expand Down Expand Up @@ -351,7 +350,9 @@ private function _canDeleteWorkflow($pk)
return true;
}

$model = new StagesModel(['ignore_request' => true]);
/** @var \Joomla\Component\Workflow\Administrator\Model\StagesModel $model */
$model = $this->app->bootComponent('com_workflow')->getMVCFactory()
->createModel('Stages', 'Administrator', ['ignore_request' => true]);

$model->setState('filter.workflow_id', $pk);
$model->setState('filter.extension', $table->extension);
Expand Down
10 changes: 6 additions & 4 deletions plugins/sampledata/blog/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Session\Session;
use Joomla\Component\Menus\Administrator\Model\ItemModel;
use Joomla\Database\ParameterType;

/**
Expand Down Expand Up @@ -59,7 +58,7 @@ class PlgSampledataBlog extends CMSPlugin
/**
* Holds the menuitem model
*
* @var ItemModel
* @var \Joomla\Component\Menus\Administrator\Model\ItemModel
*
* @since 3.8.0
*/
Expand Down Expand Up @@ -884,7 +883,8 @@ public function onAjaxSampledataApplyStep2()
$articleIds = $this->app->getUserState('sampledata.blog.articles');

// Get MenuItemModel.
$this->menuItemModel = new ItemModel;
$this->menuItemModel = $this->app->bootComponent('com_menus')->getMVCFactory()
->createModel('Item', 'Administrator', ['ignore_request' => true]);

// Get previously entered categories ids
$catIds = $this->app->getUserState('sampledata.blog.articles.catIds');
Expand Down Expand Up @@ -1410,7 +1410,9 @@ public function onAjaxSampledataApplyStep3()
$langSuffix = ($language !== '*') ? ' (' . $language . ')' : '';

// Add Include Paths.
$model = new \Joomla\Component\Modules\Administrator\Model\ModuleModel;
/** @var \Joomla\Component\Modules\Administrator\Model\ModuleModel $model */
$model = $this->app->bootComponent('com_modules')->getMVCFactory()
->createModel('Module', 'Administrator', ['ignore_request' => true]);
$access = (int) $this->app->get('access', 1);

// Get previously entered Data from UserStates.
Expand Down
9 changes: 7 additions & 2 deletions plugins/system/fields/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ public function onContentAfterSave($context, $item, $isNew, $data = array()): vo
}

// Loading the model
$model = new \Joomla\Component\Fields\Administrator\Model\FieldModel(array('ignore_request' => true));

/** @var \Joomla\Component\Fields\Administrator\Model\FieldModel $model */
$model = Factory::getApplication()->bootComponent('com_fields')->getMVCFactory()
->createModel('Field', 'Administrator', ['ignore_request' => true]);

// Loop over the fields
foreach ($fields as $field)
Expand Down Expand Up @@ -219,7 +222,9 @@ public function onContentAfterDelete($context, $item): void

$context = $parts[0] . '.' . $parts[1];

$model = new \Joomla\Component\Fields\Administrator\Model\FieldModel(array('ignore_request' => true));
/** @var \Joomla\Component\Fields\Administrator\Model\FieldModel $model */
$model = Factory::getApplication()->bootComponent('com_fields')->getMVCFactory()
->createModel('Field', 'Administrator', ['ignore_request' => true]);
$model->cleanupValues($context, $item->id);
}

Expand Down