Skip to content

Commit

Permalink
Merge branch '4.2-dev' into 4.2-finder-optimise
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored May 16, 2022
2 parents 4bcacd2 + ee81859 commit 7a4097b
Show file tree
Hide file tree
Showing 565 changed files with 3,731 additions and 1,892 deletions.
7 changes: 0 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ clone_folder: C:\projects\joomla-cms
environment:
PHPBuild: "x64"
matrix:
- php_ver_target: 7.2
- php_ver_target: 7.3
- php_ver_target: 7.4
- php_ver_target: 8.0
- php_ver_target: 8.1

matrix:
allow_failures:
- php_ver_target: 8.1

init:
- SET PATH=C:\Tools\php;%PATH%
Expand Down
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ clone:

steps:
- name: composer
image: joomlaprojects/docker-images:php7.3
image: joomlaprojects/docker-images:php7.4
volumes:
- name: composer-cache
path: /tmp/composer-cache
Expand Down Expand Up @@ -420,6 +420,6 @@ steps:

---
kind: signature
hmac: d9707d261edba35bc6b70f09a1babee119cb0a88cebda40171248e5c0a8b135e
hmac: adfaa112f82d0487b292e9b22400b04abfbf56eb44516bc764abc1804a6f472b

...
2 changes: 1 addition & 1 deletion administrator/components/com_actionlogs/actionlogs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_actionlogs</name>
<author>Joomla! Project</author>
<creationDate>May 2018</creationDate>
<creationDate>2018-05</creationDate>
<copyright>(C) 2018 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_actionlogs/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
type="logtype"
label="COM_ACTIONLOGS_LOG_EXTENSIONS_LABEL"
multiple="true"
layout="joomla.form.field.list-fancy-select"
default="com_banners,com_cache,com_categories,com_checkin,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_scheduler,com_tags,com_templates,com_users"
/>
<field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -41,7 +40,7 @@ class ExtensionField extends ListField
*/
public function getOptions()
{
$db = Factory::getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('DISTINCT ' . $db->quoteName('extension'))
->from($db->quoteName('#__action_logs'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;

/**
Expand Down Expand Up @@ -53,7 +52,7 @@ protected function getOptions()
{
static::$options[$hash] = parent::getOptions();

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

// Construct the query
$query = $db->getQuery(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
\defined('_JEXEC') or die;

use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\CheckboxesField;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
Expand All @@ -23,7 +22,7 @@
*
* @since 3.9.0
*/
class LogtypeField extends CheckboxesField
class LogtypeField extends ListField
{
/**
* The form field type.
Expand All @@ -42,21 +41,20 @@ class LogtypeField extends CheckboxesField
*/
public function getOptions()
{
$db = Factory::getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('extension'))
->from($db->quoteName('#__action_logs_extensions'));

$extensions = $db->setQuery($query)->loadColumn();

$options = array();
$tmp = array('checked' => true);
$options = [];

foreach ($extensions as $extension)
{
ActionlogsHelper::loadTranslationFiles($extension);
$option = HTMLHelper::_('select.option', $extension, Text::_($extension));
$options[ApplicationHelper::stringURLSafe(Text::_($extension)) . '_' . $extension] = (object) array_merge($tmp, (array) $option);
$extensionName = Text::_($extension);
$options[ApplicationHelper::stringURLSafe($extensionName) . '_' . $extension] = HTMLHelper::_('select.option', $extension, $extensionName);
}

ksort($options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -41,7 +40,7 @@ class PlugininfoField extends FormField
*/
protected function getInput()
{
$db = Factory::getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,13 @@ public static function loadTranslationFiles($extension)
* @return mixed An object contains content type parameters, or null if not found
*
* @since 3.9.0
*
* @deprecated 5.0 Use the action log config model instead
*/
public static function getLogContentTypeParams($context)
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('a.*')
->from($db->quoteName('#__action_log_config', 'a'))
->where($db->quoteName('a.type_alias') . ' = :context')
->bind(':context', $context);

$db->setQuery($query);

return $db->loadObject();
return Factory::getApplication()->bootComponent('actionlogs')->getMVCFactory()
->createModel('ActionlogConfig', 'Administrator')->getLogContentTypeParams($context);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Actionlogs\Administrator\Model;

\defined('_JEXEC') or die;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use stdClass;

/**
* Model to interact with the action log configuration.
*
* @since __DEPLOY_VERSION__
*/
class ActionlogConfigModel extends BaseDatabaseModel
{
/**
* Returns the action logs config for the given context.
*
* @param string $context The context of the content
*
* @return stdClass|null An object contains content type parameters, or null if not found
*
* @since __DEPLOY_VERSION__
*/
public function getLogContentTypeParams(string $context): ?stdClass
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('a.*')
->from($db->quoteName('#__action_log_config', 'a'))
->where($db->quoteName('a.type_alias') . ' = :context')
->bind(':context', $context);

$db->setQuery($query);

return $db->loadObject();
}
}
2 changes: 1 addition & 1 deletion administrator/components/com_admin/admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_admin</name>
<author>Joomla! Project</author>
<creationDate>April 2006</creationDate>
<creationDate>2006-04</creationDate>
<copyright>(C) 2006 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
4 changes: 4 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6383,6 +6383,10 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/tobscure/json-api/tests/ParametersTest.php',
'/libraries/vendor/tobscure/json-api/tests/ResourceTest.php',
'/libraries/vendor/tobscure/json-api/tests/UtilTest.php',
// From 4.1.1 to 4.1.2
'/administrator/components/com_users/src/Field/PrimaryauthprovidersField.php',
// From 4.1.2 to 4.1.3
'/libraries/vendor/webmozart/assert/.php_cs',
);

$folders = array(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE `#__mail_templates`
SET `params` = '{"tags":["message","date","extension","username"]}'
WHERE `template_id` = 'com_actionlogs.notification' AND `params` = '{"tags":["message","date","extension"]}';

UPDATE `#__mail_templates`
SET `params` = '{"tags":["sitename","name","email","subject","body","url","customfields","contactname"]}'
WHERE `template_id` = 'com_contact.mail.copy' AND `params` = '{"tags":["sitename","name","email","subject","body","url","customfields"]}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE `#__update_sites`
SET `name` = 'Joomla! Update Component'
WHERE `name` = 'Joomla! Update Component Update Site';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPDATE "#__mail_templates"
SET "params" = '{"tags":["message","date","extension","username"]}'
WHERE "template_id" = 'com_actionlogs.notification' AND "params" = '{"tags":["message","date","extension"]}';

UPDATE "#__mail_templates"
SET "params" = '{"tags":["sitename","name","email","subject","body","url","customfields","contactname"]}'
WHERE "template_id" = 'com_contact.mail.copy' AND "params" = '{"tags":["sitename","name","email","subject","body","url","customfields"]}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE "#__update_sites"
SET "name" = 'Joomla! Update Component'
WHERE "name" = 'Joomla! Update Component Update Site';
2 changes: 1 addition & 1 deletion administrator/components/com_ajax/ajax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_ajax</name>
<author>Joomla! Project</author>
<creationDate>August 2013</creationDate>
<creationDate>2013-08</creationDate>
<copyright>(C) 2013 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_associations/associations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_associations</name>
<author>Joomla! Project</author>
<creationDate>January 2017</creationDate>
<creationDate>2017-01</creationDate>
<copyright>(C) 2017 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/banners.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_banners</name>
<author>Joomla! Project</author>
<creationDate>April 2006</creationDate>
<creationDate>2006-04</creationDate>
<copyright>(C) 2006 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Joomla\CMS\Tag\TagServiceInterface;
use Joomla\CMS\Tag\TagServiceTrait;
use Joomla\Component\Banners\Administrator\Service\Html\Banner;
use Joomla\Database\DatabaseInterface;
use Psr\Container\ContainerInterface;

/**
Expand Down Expand Up @@ -53,7 +54,10 @@ class BannersComponent extends MVCComponent implements BootableExtensionInterfac
*/
public function boot(ContainerInterface $container)
{
$this->getRegistry()->register('banner', new Banner);
$banner = new Banner;
$banner->setDatabase($container->get(DatabaseInterface::class));

$this->getRegistry()->register('banner', $banner);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Database\DatabaseAwareTrait;

/**
* Banner HTML class.
Expand All @@ -22,6 +23,8 @@
*/
class Banner
{
use DatabaseAwareTrait;

/**
* Display a batch widget for the client selector.
*
Expand Down Expand Up @@ -56,7 +59,7 @@ public function clients()
*/
public function clientlist()
{
$db = Factory::getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

/** @var \Joomla\Component\Banners\Administrator\View\Download\HtmlView $this */

HTMLHelper::_('behavior.formvalidator');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('form.validate');

?>
<div class="container-popup">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_cache/cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_cache</name>
<author>Joomla! Project</author>
<creationDate>April 2006</creationDate>
<creationDate>2006-04</creationDate>
<copyright>(C) 2006 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_cache/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
filter="rules"
validate="rules"
component="com_cache"
section="component" />
section="component"
/>
</fieldset>
</config>
2 changes: 1 addition & 1 deletion administrator/components/com_categories/categories.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" method="upgrade">
<name>com_categories</name>
<author>Joomla! Project</author>
<creationDate>December 2007</creationDate>
<creationDate>2007-12</creationDate>
<copyright>(C) 2007 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected function getOptions()
? (int) reset($oldCat)
: (int) $oldCat;

$db = Factory::getDbo();
$db = $this->getDatabase();
$user = Factory::getUser();

$query = $db->getQuery(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ComponentsCategoryField extends ListField
protected function getOptions()
{
// Initialise variable.
$db = Factory::getDbo();
$db = $this->getDatabase();
$options = array();

$query = $db->getQuery(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function getInput()

if ($value)
{
$db = Factory::getDbo();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__categories'))
Expand Down
Loading

0 comments on commit 7a4097b

Please sign in to comment.