Skip to content

Commit

Permalink
Merge tag 'psr12anchor' into psr12/merge/36954
Browse files Browse the repository at this point in the history
  • Loading branch information
joomla-bot committed Jun 27, 2022
2 parents 6fdec25 + 170f91a commit ce6a330
Show file tree
Hide file tree
Showing 536 changed files with 9,794 additions and 4,206 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Expand Up @@ -44,7 +44,7 @@ install:
- choco install composer
- cd C:\projects\joomla-cms
- refreshenv
- composer install --no-progress --profile
- composer install --no-progress --profile --ignore-platform-req=ext-sodium
before_test:
# Database setup for MySQL via PowerShell tools
- >
Expand Down
5 changes: 1 addition & 4 deletions .drone.yml
Expand Up @@ -59,7 +59,6 @@ steps:
- name: php81-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.1
failure: ignore
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
Expand Down Expand Up @@ -88,7 +87,6 @@ steps:
- name: php80-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.0
failure: ignore
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
Expand Down Expand Up @@ -131,7 +129,6 @@ steps:
- name: php80-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.0
failure: ignore
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
Expand Down Expand Up @@ -478,6 +475,6 @@ trigger:

---
kind: signature
hmac: 234ae9e7e2fbfa114ba754c68056dec518c76a93de2f5b098f569e355b50cc1b
hmac: d5db8148323f0205a8c0cd165da3934f5a77b25f73862d09ead95d3c42f1df01

...
5 changes: 5 additions & 0 deletions .github/workflows/create-translation-pull-request-v4.yml
Expand Up @@ -10,8 +10,13 @@ on:
# Run daily at 7:26
- cron: '26 7 * * *'

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
# Only run this action the translation-bot repository in the translation branch
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation' }}
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_actionlogs/config.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<config addfieldprefix="Joomla\Component\Actionlogs\Administrator\Field">
<help key="User_Actions_Log:_Options"/>
<inlinehelp button="show"/>
<fieldset name="actionlogs" label="COM_ACTIONLOGS_OPTIONS">
<field
name="ip_logging"
Expand Down
Expand Up @@ -45,7 +45,7 @@ class ActionlogModel extends BaseDatabaseModel
public function addLog($messages, $messageLanguageKey, $context, $userId = null)
{
$user = Factory::getUser($userId);
$db = $this->getDbo();
$db = $this->getDatabase();
$date = Factory::getDate();
$params = ComponentHelper::getComponent('com_actionlogs')->getParams();

Expand Down Expand Up @@ -116,7 +116,7 @@ protected function sendNotificationEmails($messages, $username, $context)
{
$app = Factory::getApplication();
$lang = $app->getLanguage();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

$query
Expand Down
Expand Up @@ -87,7 +87,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc')
*/
protected function getListQuery()
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->select($db->quoteName('u.name'))
Expand Down Expand Up @@ -243,7 +243,7 @@ private function buildDateRange($range)
public function getLogsForItem($extension, $itemId)
{
$itemId = (int) $itemId;
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->select($db->quoteName('u.name'))
Expand Down Expand Up @@ -279,7 +279,7 @@ public function getLogsForItem($extension, $itemId)
*/
public function getLogsData($pks = null)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $this->getLogDataQuery($pks);

$db->setQuery($query);
Expand All @@ -298,7 +298,7 @@ public function getLogsData($pks = null)
*/
public function getLogDataAsIterator($pks = null)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $this->getLogDataQuery($pks);

$db->setQuery($query);
Expand All @@ -317,7 +317,7 @@ public function getLogDataAsIterator($pks = null)
*/
private function getLogDataQuery($pks = null)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->select($db->quoteName('u.name'))
Expand Down Expand Up @@ -345,7 +345,7 @@ private function getLogDataQuery($pks = null)
public function delete(&$pks)
{
$keys = ArrayHelper::toInteger($pks);
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->delete($db->quoteName('#__action_logs'))
->whereIn($db->quoteName('id'), $keys);
Expand Down Expand Up @@ -378,7 +378,7 @@ public function purge()
{
try
{
$this->getDbo()->truncateTable('#__action_logs');
$this->getDatabase()->truncateTable('#__action_logs');
}
catch (Exception $e)
{
Expand Down
14 changes: 14 additions & 0 deletions administrator/components/com_admin/script.php
Expand Up @@ -501,6 +501,7 @@ protected function uninstallRepeatableFieldsPlugin()

// And now uninstall the plugin
$installer = new Installer;
$installer->setDatabase($db);
$installer->uninstall('plugin', $extensionId);

$db->transactionCommit();
Expand Down Expand Up @@ -551,6 +552,7 @@ protected function uninstallEosPlugin()

// Uninstall the plugin
$installer = new Installer;
$installer->setDatabase($db);
$installer->uninstall('plugin', $extensionId);

$db->transactionCommit();
Expand Down Expand Up @@ -607,6 +609,7 @@ protected function updateManifestCaches()
}

$installer = new Installer;
$installer->setDatabase($db);

foreach ($extensions as $extension)
{
Expand Down Expand Up @@ -6474,6 +6477,14 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/plugins/twofactorauth/yubikey/tmpl/form.php',
'/plugins/twofactorauth/yubikey/yubikey.php',
'/plugins/twofactorauth/yubikey/yubikey.xml',
// From 4.2.0-beta1 to 4.2.0-beta2
'/layouts/plugins/user/profile/fields/dob.php',
'/modules/mod_articles_latest/mod_articles_latest.php',
'/plugins/behaviour/taggable/taggable.php',
'/plugins/behaviour/versionable/versionable.php',
'/plugins/task/requests/requests.php',
'/plugins/task/sitestatus/sitestatus.php',
'/plugins/user/profile/src/Field/DobField.php',
);

$folders = array(
Expand Down Expand Up @@ -7835,6 +7846,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/plugins/twofactorauth/totp',
'/plugins/twofactorauth',
'/libraries/vendor/nyholm/psr7/doc',
// From 4.2.0-beta1 to 4.2.0-beta2
'/layouts/plugins/user/profile/fields',
'/layouts/plugins/user/profile',
);

$status['files_checked'] = $files;
Expand Down
@@ -0,0 +1,4 @@
--
-- Increase the size of the htmlbody field in the #__mail_templates table
--
ALTER TABLE `#__mail_templates` MODIFY `htmlbody` mediumtext NOT NULL COLLATE 'utf8mb4_unicode_ci';
@@ -0,0 +1,3 @@
-- See https://github.com/joomla/joomla-cms/pull/38092
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
(0, 'plg_system_shortcut', 'plugin', 'shortcut', 'system', 0, 1, 1, 0, 1, '', '', '', 0, 0);
@@ -0,0 +1,3 @@
-- See https://github.com/joomla/joomla-cms/pull/38092
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
(0, 'plg_system_shortcut', 'plugin', 'shortcut', 'system', 0, 1, 1, 0, 1, '', '', '', 0, 0);
Expand Up @@ -315,7 +315,7 @@ public function &getInfo(): array
return $this->info;
}

$db = $this->getDbo();
$db = $this->getDatabase();

$this->info = [
'php' => php_uname(),
Expand Down
Expand Up @@ -180,7 +180,7 @@ protected function getListQuery()

// Create a new query object.
$user = Factory::getUser();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

$details = $type->get('details');
Expand Down Expand Up @@ -505,7 +505,7 @@ protected function getListQuery()
public function purge($context = '', $key = '')
{
$app = Factory::getApplication();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)->delete($db->quoteName('#__associations'));

// Filter by associations context.
Expand Down Expand Up @@ -556,7 +556,7 @@ public function purge($context = '', $key = '')
public function clean($context = '', $key = '')
{
$app = Factory::getApplication();
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('key') . ', COUNT(*)')
->from($db->quoteName('#__associations'))
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_banners/config.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<help key="Banners:_Options"/>
<inlinehelp button="show"/>
<fieldset
name="component"
label="COM_BANNERS_FIELDSET_CONFIG_CLIENT_OPTIONS_LABEL"
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_banners/forms/filter_tracks.xml
Expand Up @@ -63,6 +63,7 @@
hint="COM_BANNERS_BEGIN_HINT"
format="%Y-%m-%d"
filter="user_utc"
onchange="this.form.submit();"
/>

<field
Expand All @@ -72,6 +73,7 @@
hint="COM_BANNERS_END_HINT"
format="%Y-%m-%d"
filter="user_utc"
onchange="this.form.submit();"
/>
</fields>
<fields name="list">
Expand Down
Expand Up @@ -303,9 +303,11 @@ public function stick(&$pks, $value = 1)
*/
protected function getReorderConditions($table)
{
$db = $this->getDatabase();

return [
$this->_db->quoteName('catid') . ' = ' . (int) $table->catid,
$this->_db->quoteName('state') . ' >= 0',
$db->quoteName('catid') . ' = ' . (int) $table->catid,
$db->quoteName('state') . ' >= 0',
];
}

Expand All @@ -332,7 +334,7 @@ protected function prepareTable($table)
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('MAX(' . $db->quoteName('ordering') . ')')
->from($db->quoteName('#__banners'));
Expand Down
Expand Up @@ -73,7 +73,7 @@ public function &getCategoryOrders()
{
if (!isset($this->cache['categoryorders']))
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select(
[
Expand All @@ -99,7 +99,7 @@ public function &getCategoryOrders()
*/
protected function getListQuery()
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

// Select the required fields from the table.
Expand Down
Expand Up @@ -97,7 +97,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

$defaultPurchase = (int) ComponentHelper::getParams('com_banners')->get('purchase_type', 3);
Expand Down Expand Up @@ -232,7 +232,7 @@ public function getItems()
// Faster to do three queries for very large banner trees.

// Get the clients in the list.
$db = $this->getDbo();
$db = $this->getDatabase();
$clientIds = array_column($items, 'id');

$query = $db->getQuery(true)
Expand Down
Expand Up @@ -91,7 +91,7 @@ protected function populateState($ordering = 'b.name', $direction = 'asc')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);

// Select the required fields from the table.
Expand Down Expand Up @@ -206,7 +206,7 @@ public function delete()
if ($allow)
{
// Delete tracks from this banner
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->delete($db->quoteName('#__banner_tracks'));

Expand Down Expand Up @@ -381,7 +381,7 @@ protected function getCategoryName()

if ($categoryId)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__categories'))
Expand Down Expand Up @@ -419,7 +419,7 @@ protected function getClientName()

if ($clientId)
{
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('name'))
->from($db->quoteName('#__banner_clients'))
Expand Down
Expand Up @@ -163,7 +163,7 @@ protected function getStoreId($id = '')
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true);
$user = Factory::getUser();

Expand Down Expand Up @@ -511,7 +511,7 @@ protected function getEmptyStateQuery()
// Get the extension from the filter
$extension = $this->getState('filter.extension');

$query->where($this->_db->quoteName('extension') . ' = :extension')
$query->where($this->getDatabase()->quoteName('extension') . ' = :extension')
->bind(':extension', $extension);

return $query;
Expand Down

0 comments on commit ce6a330

Please sign in to comment.