Skip to content

Commit

Permalink
Merge branch '5.1-dev' into 5.1-cli-core-update-channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzo1987 committed Jan 18, 2024
2 parents b4ce80a + 3760098 commit 9d19a58
Show file tree
Hide file tree
Showing 110 changed files with 2,008 additions and 1,240 deletions.
31 changes: 26 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ clone:

steps:
- name: setup
image: joomlaprojects/docker-images:php8.2
image: joomlaprojects/docker-images:php8.3
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/certs/* /certificates/

- name: composer
image: joomlaprojects/docker-images:php8.2
image: joomlaprojects/docker-images:php8.3
volumes:
- name: composer-cache
path: /tmp/composer-cache
Expand Down Expand Up @@ -63,6 +63,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php83-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php81-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
Expand All @@ -77,6 +84,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php83-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php81-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
Expand All @@ -91,6 +105,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: php83-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: scss-cs
depends_on: [ npm ]
image: node:current-alpine
Expand Down Expand Up @@ -145,7 +166,7 @@ steps:
- name: phpnext-system-mysql
depends_on:
- phpmax-system-mysql
image: joomlaprojects/docker-images:cypress8.2
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
Expand Down Expand Up @@ -184,7 +205,7 @@ steps:
- name: phpnext-system-postgres
depends_on:
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress8.2
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
Expand Down Expand Up @@ -382,6 +403,6 @@ trigger:

---
kind: signature
hmac: 5814cadc441b90eec51da0aa32cd29ff1014c4d759841cc70063b5e9245d2b08
hmac: e8ab45eb1d91c0b0b38c8d25a3a983d112c973dcba0153a982f2afd581dfa458

...
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ public static function loadActionLogPluginsLanguage()
// Load plg_system_actionlogs too
$lang->load('plg_system_actionlogs', JPATH_ADMINISTRATOR);

// Load plg_system_privacyconsent too
$lang->load('plg_system_privacyconsent', JPATH_ADMINISTRATOR);

// Load plg_user_terms too
$lang->load('plg_user_terms', JPATH_ADMINISTRATOR);

// Load com_privacy too.
$lang->load('com_privacy', JPATH_ADMINISTRATOR);
}
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 @@ -387,10 +387,10 @@ private function migrateLogRotationPlugin($data)
return;
}

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);

// Get the timeout, as configured in plg_system_logrotation
Expand Down Expand Up @@ -433,10 +433,10 @@ private function migrateSessionGCPlugin($data)
// Get the plugin parameters
$params = new Registry($data->params);

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Session GC',
Expand Down Expand Up @@ -478,10 +478,10 @@ private function migrateUpdatenotificationPlugin($data)
$params = new Registry($data->params);
$lastrun = (int) $params->get('lastrun', time());

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Update Notification',
Expand Down Expand Up @@ -2632,10 +2632,10 @@ private function migrateDeleteActionlogsConfiguration(): bool
return true;
}

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Delete Action Logs',
Expand Down Expand Up @@ -2701,10 +2701,10 @@ private function migratePrivacyconsentConfiguration(): bool
return true;
}

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Privacy Consent',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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_schemaorg_article', 'plugin', 'article', 'schemaorg', 0, 1, 1, 0, 0, '', '{}', '', 0, 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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_schemaorg_article', 'plugin', 'article', 'schemaorg', 0, 1, 1, 0, 0, '', '{}', '', 0, 0);
29 changes: 10 additions & 19 deletions administrator/components/com_cpanel/tmpl/cpanel/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
defined('_JEXEC') or die;

use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Registry\Registry;
Expand All @@ -28,26 +27,16 @@
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_cpanel.admin-cpanel')
->useScript('com_cpanel.admin-addmodule');
->useScript('joomla.dialog-autocreate');

$user = $this->getCurrentUser();

// Set up the bootstrap modal that will be used for all module editors
echo HTMLHelper::_(
'bootstrap.renderModal',
'moduleDashboardAddModal',
[
'title' => Text::_('COM_CPANEL_ADD_MODULE_MODAL_TITLE'),
'backdrop' => 'static',
'url' => Route::_('index.php?option=com_cpanel&task=addModule&function=jSelectModuleType&position=' . $this->escape($this->position)),
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<button type="button" class="button-cancel btn btn-danger" data-bs-dismiss="modal" data-bs-target="#closeBtn">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" id="btnModalSaveAndClose" class="button-save btn btn-success hidden" data-bs-target="#saveBtn">'
. Text::_('JSAVE') . '</button>',
]
);
// Set up the modal options that will be used for module editor
$popupOptions = [
'popupType' => 'iframe',
'src' => Route::_('index.php?option=com_cpanel&task=addModule&position=' . $this->position, false),
'textHeader' => Text::_('COM_CPANEL_ADD_MODULE_MODAL_TITLE'),
];
?>
<div id="cpanel-modules">
<div class="cpanel-modules <?php echo $this->position; ?>">
Expand All @@ -69,7 +58,9 @@
<?php if ($user->authorise('core.create', 'com_modules')) : ?>
<div class="module-wrapper">
<div class="card">
<button type="button" data-bs-toggle="modal" data-bs-target="#moduleDashboardAddModal" class="cpanel-add-module">
<button type="button" class="cpanel-add-module"
data-joomla-dialog="<?php echo htmlspecialchars(json_encode($popupOptions, JSON_UNESCAPED_SLASHES)) ?>"
data-close-on-message data-reload-on-close>
<div class="cpanel-add-module-icon">
<span class="icon-plus-square" aria-hidden="true"></span>
</div>
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_fields/src/Helper/FieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ public static function extract($contextString, $item = null)
* The values of the fields can be overridden by an associative array where the keys
* have to be a name and its corresponding value.
*
* @param string $context The context of the content passed to the helper
* @param null $item The item being edited in the form
* @param int|bool $prepareValue (if int is display event): 1 - AfterTitle, 2 - BeforeDisplay, 3 - AfterDisplay, 0 - OFF
* @param array|null $valuesToOverride The values to override
* @param bool $includeSubformFields Should I include fields marked as Only Use In Subform?
* @param string $context The context of the content passed to the helper
* @param object|array|null $item The item being edited in the form
* @param int|bool $prepareValue (if int is display event): 1 - AfterTitle, 2 - BeforeDisplay, 3 - AfterDisplay, 0 - OFF
* @param array|null $valuesToOverride The values to override
* @param bool $includeSubformFields Should I include fields marked as Only Use In Subform?
*
* @return array
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@

namespace Joomla\Component\Finder\Administrator\Controller;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Finder\Administrator\Helper\FinderHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -53,21 +50,6 @@ public function display($cachable = false, $urlparams = [])
$layout = $this->input->get('layout', 'index', 'word');
$filterId = $this->input->get('filter_id', null, 'int');

if ($view === 'index') {
$pluginEnabled = PluginHelper::isEnabled('content', 'finder');

if (!$pluginEnabled) {
$finderPluginId = FinderHelper::getFinderPluginId();
$link = HTMLHelper::_(
'link',
'#plugin' . $finderPluginId . 'Modal',
Text::_('COM_FINDER_CONTENT_PLUGIN'),
'class="alert-link" data-bs-toggle="modal" id="title-' . $finderPluginId . '"'
);
$this->app->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
}
}

// Check for edit form.
if ($view === 'filter' && $layout === 'edit' && !$this->checkEditId('com_finder.edit.filter', $filterId)) {
// Somehow the person just went to the form - we don't allow that.
Expand Down
52 changes: 26 additions & 26 deletions administrator/components/com_finder/tmpl/index/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
Expand All @@ -24,38 +25,37 @@
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('multiselect')
->useScript('table.columns');
->useScript('table.columns')
->useScript('joomla.dialog-autocreate');

// Show warning that the content - finder plugin is disabled
if ($this->finderPluginId) {
$popupOptions = [
'popupType' => 'iframe',
'textHeader' => Text::_('COM_FINDER_EDIT_PLUGIN_SETTINGS'),
'src' => Route::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $this->finderPluginId . '&tmpl=component&layout=modal', false),
];
$link = HTMLHelper::_(
'link',
'#',
Text::_('COM_FINDER_CONTENT_PLUGIN'),
[
'class' => 'alert-link',
'data-joomla-dialog' => $this->escape(json_encode($popupOptions, JSON_UNESCAPED_SLASHES)),
'data-checkin-url' => Route::_('index.php?option=com_plugins&task=plugins.checkin&format=json&cid[]=' . $this->finderPluginId),
'data-close-on-message' => '',
'data-reload-on-close' => '',
],
);
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
}

?>
<form action="<?php echo Route::_('index.php?option=com_finder&view=index'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
<?php if ($this->finderPluginId) : ?>
<?php $link = Route::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $this->finderPluginId . '&tmpl=component&layout=modal'); ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'plugin' . $this->finderPluginId . 'Modal',
[
'url' => $link,
'title' => Text::_('COM_FINDER_EDIT_PLUGIN_SETTINGS'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'closeButton' => false,
'backdrop' => 'static',
'keyboard' => false,
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->finderPluginId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->finderPluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->finderPluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
. Text::_("JAPPLY") . '</button>'
]
); ?>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
Expand Down

0 comments on commit 9d19a58

Please sign in to comment.