Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ExtensionField extends ListField
public function getOptions()
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('DISTINCT ' . $db->quoteName('extension'))
->from($db->quoteName('#__action_logs'))
->order($db->quoteName('extension'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function getOptions()
$db = $this->getDatabase();

// Construct the query
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('u.id', 'value'))
->select($db->quoteName('u.username', 'text'))
->from($db->quoteName('#__users', 'u'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LogtypeField extends ListField
public function getOptions()
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('extension'))
->from($db->quoteName('#__action_logs_extensions'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PlugininfoField extends FormField
protected function getInput()
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('actionlog'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static function loadActionLogPluginsLanguage()
$db = Factory::getDbo();

// Get all (both enabled and disabled) actionlog plugins
$query = $db->getQuery(true)
$query = $db->createQuery()
->select(
$db->quoteName(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ActionlogConfigModel extends BaseDatabaseModel
public function getLogContentTypeParams(string $context): ?\stdClass
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('a.*')
->from($db->quoteName('#__action_log_config', 'a'))
->where($db->quoteName('a.type_alias') . ' = :context')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected function sendNotificationEmails($messages, $username, $context)
$app = Factory::getApplication();
$lang = $app->getLanguage();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$query = $db->createQuery();

$query
->select($db->quoteName(['u.email', 'l.extensions']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc')
protected function getListQuery()
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('a.*')
->select($db->quoteName('u.name'))
->from($db->quoteName('#__action_logs', 'a'))
Expand Down Expand Up @@ -232,7 +232,7 @@ public function getLogsForItem($extension, $itemId)
{
$itemId = (int) $itemId;
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('a.*')
->select($db->quoteName('u.name'))
->from($db->quoteName('#__action_logs', 'a'))
Expand Down Expand Up @@ -305,7 +305,7 @@ public function getLogDataAsIterator($pks = null)
private function getLogDataQuery($pks = null)
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('a.*')
->select($db->quoteName('u.name'))
->from($db->quoteName('#__action_logs', 'a'))
Expand All @@ -332,7 +332,7 @@ public function delete(&$pks)
{
$keys = ArrayHelper::toInteger($pks);
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->delete($db->quoteName('#__action_logs'))
->whereIn($db->quoteName('id'), $keys);
$db->setQuery($query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
function admin_postinstall_languageaccess340_condition()
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('access'))
->from($db->quoteName('#__languages'))
->where($db->quoteName('access') . ' = ' . $db->quote('0'));
Expand Down
20 changes: 10 additions & 10 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function clearStatsCache()
try {
// Get the params for the stats plugin
$params = $db->setQuery(
$db->getQuery(true)
$db->createQuery()
->select($db->quoteName('params'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
Expand All @@ -196,7 +196,7 @@ protected function clearStatsCache()

$params = json_encode($params);

$query = $db->getQuery(true)
$query = $db->createQuery()
->update($db->quoteName('#__extensions'))
->set($db->quoteName('params') . ' = ' . $db->quote($params))
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
Expand Down Expand Up @@ -300,7 +300,7 @@ protected function uninstallExtensions()

foreach ($extensions as $extension) {
$row = $db->setQuery(
$db->getQuery(true)
$db->createQuery()
->select('*')
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote($extension['type']))
Expand All @@ -324,7 +324,7 @@ protected function uninstallExtensions()

// Unlock and unprotect the plugin so we can uninstall it
$db->setQuery(
$db->getQuery(true)
$db->createQuery()
->update($db->quoteName('#__extensions'))
->set($db->quoteName('locked') . ' = 0')
->set($db->quoteName('protected') . ' = 0')
Expand Down Expand Up @@ -359,7 +359,7 @@ private function migrateCompatPlugin($rowOld)
$db = Factory::getDbo();

$db->setQuery(
$db->getQuery(true)
$db->createQuery()
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = :enabled')
->set($db->quoteName('params') . ' = :params')
Expand Down Expand Up @@ -512,7 +512,7 @@ protected function updateManifestCaches()

// Attempt to refresh manifest caches
$db = Factory::getDbo();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('*')
->from('#__extensions');

Expand Down Expand Up @@ -2792,7 +2792,7 @@ private function migrateDeleteActionlogsConfiguration(): bool
try {
// Get the ActionLogs system plugin's parameters
$row = $db->setQuery(
$db->getQuery(true)
$db->createQuery()
->select([$db->quotename('enabled'), $db->quoteName('params')])
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
Expand Down Expand Up @@ -2861,7 +2861,7 @@ private function migratePrivacyconsentConfiguration(): bool
try {
// Get the PrivacyConsent system plugin's parameters
$row = $db->setQuery(
$db->getQuery(true)
$db->createQuery()
->select([$db->quotename('enabled'), $db->quoteName('params')])
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
Expand Down Expand Up @@ -2935,7 +2935,7 @@ private function migrateTinymceConfiguration(): bool
try {
// Get the TinyMCE editor plugin's parameters
$params = $db->setQuery(
$db->getQuery(true)
$db->createQuery()
->select($db->quoteName('params'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
Expand Down Expand Up @@ -3007,7 +3007,7 @@ private function migrateTinymceConfiguration(): bool

$params = json_encode($params);

$query = $db->getQuery(true)
$query = $db->createQuery()
->update($db->quoteName('#__extensions'))
->set($db->quoteName('params') . ' = ' . $db->quote($params))
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public function getExtensions(): array
{
$installed = [];
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('*')
->from($db->quoteName('#__extensions'));
$db->setQuery($query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
$db = Factory::getDbo();

// Get the category name
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('title'))
->from($db->quoteName('#__categories'))
->where($db->quoteName('id') . ' = :id')
Expand All @@ -272,7 +272,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
$db = Factory::getDbo();

// Get the menutype name
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('title'))
->from($db->quoteName('#__menu_types'))
->where($db->quoteName('menutype') . ' = :menutype')
Expand Down Expand Up @@ -448,7 +448,7 @@ private static function getEnabledExtensions()
{
$db = Factory::getDbo();

$query = $db->getQuery(true)
$query = $db->createQuery()
->select('*')
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
Expand Down Expand Up @@ -653,7 +653,7 @@ public static function getTypeFieldName($extensionName, $typeName, $fieldName)
public static function getLanguagefilterPluginId()
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected function getListQuery()
// Create a new query object.
$user = $this->getCurrentUser();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$query = $db->createQuery();

$details = $type->get('details');

Expand Down Expand Up @@ -462,7 +462,7 @@ public function purge($context = '', $key = '')
{
$app = Factory::getApplication();
$db = $this->getDatabase();
$query = $db->getQuery(true)->delete($db->quoteName('#__associations'));
$query = $db->createQuery()->delete($db->quoteName('#__associations'));

// Filter by associations context.
if ($context) {
Expand Down Expand Up @@ -508,7 +508,7 @@ public function clean($context = '', $key = '')
{
$app = Factory::getApplication();
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select($db->quoteName('key') . ', COUNT(*)')
->from($db->quoteName('#__associations'))
->group($db->quoteName('key'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

$iconStates = [
-2 => 'icon-trash',
0 => 'icon-times',
1 => 'icon-check',
2 => 'icon-folder',
0 => 'icon-unpublish',
1 => 'icon-publish',
2 => 'icon-archive',
];

Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

$iconStates = [
-2 => 'icon-trash',
0 => 'icon-times',
1 => 'icon-check',
2 => 'icon-folder',
0 => 'icon-unpublish',
1 => 'icon-publish',
2 => 'icon-archive',
];

$this->getDocument()->addScriptOptions('associations-modal', ['func' => $function]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function updateReset()
$app = Factory::getApplication();
$user = $app->getIdentity();

$query = $db->getQuery(true)
$query = $db->createQuery()
->select('*')
->from($db->quoteName('#__banners'))
->where(
Expand Down Expand Up @@ -111,7 +111,7 @@ public static function updateReset()
}

// Update the row ordering field.
$query = $db->getQuery(true)
$query = $db->createQuery()
->update($db->quoteName('#__banners'))
->set(
[
Expand Down Expand Up @@ -148,7 +148,7 @@ public static function getClientOptions()
$options = [];

$db = Factory::getDbo();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select(
[
$db->quoteName('id', 'value'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId)
// Initialise clicks and impmade
$db = $this->getDatabase();

$query = $db->getQuery(true)
$query = $db->createQuery()
->update($db->quoteName('#__banners'))
->set($db->quoteName('clicks') . ' = 0')
->set($db->quoteName('impmade') . ' = 0')
Expand Down Expand Up @@ -351,7 +351,7 @@ protected function prepareTable($table)
// Set ordering to the last item if not set
if (empty($table->ordering)) {
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select('MAX(' . $db->quoteName('ordering') . ')')
->from($db->quoteName('#__banners'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function &getCategoryOrders()
{
if (!isset($this->cache['categoryorders'])) {
$db = $this->getDatabase();
$query = $db->getQuery(true)
$query = $db->createQuery()
->select(
[
'MAX(' . $db->quoteName('ordering') . ') AS ' . $db->quoteName('max'),
Expand All @@ -102,7 +102,7 @@ public function &getCategoryOrders()
protected function getListQuery()
{
$db = $this->getDatabase();
$query = $db->getQuery(true);
$query = $db->createQuery();

// Select the required fields from the table.
$query->select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function getListQuery()
{
// Create a new query object.
$db = $this->getDatabase();
$query = $db->getQuery(true);
$query = $db->createQuery();

$defaultPurchase = (int) ComponentHelper::getParams('com_banners')->get('purchase_type', 3);

Expand Down Expand Up @@ -225,7 +225,7 @@ public function getItems()
$db = $this->getDatabase();
$clientIds = array_column($items, 'id');

$query = $db->getQuery(true)
$query = $db->createQuery()
->select(
[
$db->quoteName('cid'),
Expand Down
Loading