diff --git a/src/administrator/components/com_weblinks/src/Model/WeblinkModel.php b/src/administrator/components/com_weblinks/src/Model/WeblinkModel.php index 769689c2bf..b85232dedc 100644 --- a/src/administrator/components/com_weblinks/src/Model/WeblinkModel.php +++ b/src/administrator/components/com_weblinks/src/Model/WeblinkModel.php @@ -152,6 +152,7 @@ public function getForm($data = [], $loadData = true) */ protected function loadFormData() { + /** @var \Joomla\CMS\Application\CMSApplication $app */ $app = Factory::getApplication(); // Check the session for previously entered form data. @@ -352,7 +353,7 @@ protected function generateNewTitle($category_id, $alias, $name) /** * Allows preprocessing of the JForm object. * - * @param \JForm $form The form object + * @param Form $form The form object * @param array $data The data to be merged into the form object * @param string $group The plugin group to be executed * @@ -368,7 +369,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content') // Association weblinks items if (Associations::isEnabled()) { - $languages = LanguageHelper::getContentLanguages(false, false, null, 'ordering', 'asc'); + $languages = LanguageHelper::getContentLanguages([], false, 'lang_code', 'ordering', 'asc'); if (\count($languages) > 1) { $addform = new \SimpleXMLElement('
'); diff --git a/src/administrator/components/com_weblinks/src/Model/WeblinksModel.php b/src/administrator/components/com_weblinks/src/Model/WeblinksModel.php index ced77a64f2..079a1c4d3d 100644 --- a/src/administrator/components/com_weblinks/src/Model/WeblinksModel.php +++ b/src/administrator/components/com_weblinks/src/Model/WeblinksModel.php @@ -20,6 +20,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; /** * Methods supporting a list of weblink records. @@ -145,7 +146,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \JDatabaseQuery + * @return QueryInterface * * @since 1.6 */ @@ -169,19 +170,19 @@ protected function getListQuery() // Join over the language $query->select($db->quoteName('l.title', 'language_title')) ->select($db->quoteName('l.image', 'language_image')) - ->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON ' . $db->qn('l.lang_code') . ' = ' . $db->qn('a.language')); + ->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON ' . $db->quoteName('l.lang_code') . ' = ' . $db->quoteName('a.language')); // Join over the users for the checked out user. $query->select($db->quoteName('uc.name', 'editor')) - ->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON ' . $db->qn('uc.id') . ' = ' . $db->qn('a.checked_out')); + ->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON ' . $db->quoteName('uc.id') . ' = ' . $db->quoteName('a.checked_out')); // Join over the asset groups. $query->select($db->quoteName('ag.title', 'access_level')) - ->join('LEFT', $db->quoteName('#__viewlevels', 'ag') . ' ON ' . $db->qn('ag.id') . ' = ' . $db->qn('a.access')); + ->join('LEFT', $db->quoteName('#__viewlevels', 'ag') . ' ON ' . $db->quoteName('ag.id') . ' = ' . $db->quoteName('a.access')); // Join over the categories. $query->select('c.title AS category_title') - ->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON ' . $db->qn('c.id') . ' = ' . $db->qn('a.catid')); + ->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('a.catid')); // Join over the associations. $assoc = Associations::isEnabled(); @@ -195,8 +196,8 @@ protected function getListQuery() // Filter by access level. if ($access = $this->getState('filter.access')) { - $query->where($db->quoteName('a.access') . ' = :access') - ->bind(':access', $access, ParameterType::INTEGER); + $query->where($db->quoteName('a.access') . ' = :access'); + $query->bind(':access', $access, ParameterType::INTEGER); } // Implement View Level Access @@ -208,8 +209,8 @@ protected function getListQuery() $published = (string) $this->getState('filter.published'); if (is_numeric($published)) { - $query->where($db->quoteName('a.state') . ' = :state') - ->bind(':state', $published, ParameterType::INTEGER); + $query->where($db->quoteName('a.state') . ' = :state'); + $query->bind(':state', $published, ParameterType::INTEGER); } elseif ($published === '') { $query->whereIn($db->quoteName('a.state'), [0, 1]); } @@ -218,14 +219,14 @@ protected function getListQuery() $categoryId = $this->getState('filter.category_id'); if (is_numeric($categoryId)) { - $query->where($db->quoteName('a.catid') . ' = :catid') - ->bind(':catid', $categoryId, ParameterType::INTEGER); + $query->where($db->quoteName('a.catid') . ' = :catid'); + $query->bind(':catid', $categoryId, ParameterType::INTEGER); } // Filter on the level. if ($level = $this->getState('filter.level')) { - $query->where($db->quoteName('c.level') . ' <= :level') - ->bind(':level', $level, ParameterType::INTEGER); + $query->where($db->quoteName('c.level') . ' <= :level'); + $query->bind(':level', $level, ParameterType::INTEGER); } // Filter by search in title @@ -234,20 +235,20 @@ protected function getListQuery() if (!empty($search)) { if (stripos($search, 'id:') === 0) { $search = substr($search, 3); - $query->where($db->quoteName('a.id') . ' = :id') - ->bind(':id', $search, ParameterType::INTEGER); + $query->where($db->quoteName('a.id') . ' = :id'); + $query->bind(':id', $search, ParameterType::INTEGER); } else { $search = '%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'); - $query->where('(' . $db->quoteName('a.title') . ' LIKE :title OR ' . $db->quoteName('a.alias') . ' LIKE :alias)') - ->bind(':title', $search) + $query->where('(' . $db->quoteName('a.title') . ' LIKE :title OR ' . $db->quoteName('a.alias') . ' LIKE :alias)'); + $query->bind(':title', $search) ->bind(':alias', $search); } } // Filter on the language. if ($language = $this->getState('filter.language')) { - $query->where($db->quoteName('a.language') . ' = :language') - ->bind(':language', $language); + $query->where($db->quoteName('a.language') . ' = :language'); + $query->bind(':language', $language); } $tagId = $this->getState('filter.tag');