Skip to content

Commit

Permalink
Merge pull request joomla#40640 from richard67/5.0-dev-test-upmerge-2…
Browse files Browse the repository at this point in the history
…023-05-21

[5.0] Upmerge from 4.4-dev as of today, May 21, 2023
  • Loading branch information
HLeithner authored May 21, 2023
2 parents 1a91093 + 7b38885 commit 0b5f709
Show file tree
Hide file tree
Showing 374 changed files with 4,121 additions and 1,740 deletions.
6 changes: 5 additions & 1 deletion administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

use Joomla\CMS\Extension\ExtensionHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Table\Table;
use Joomla\Component\Fields\Administrator\Model\FieldModel;
use Joomla\Database\ParameterType;
use Joomla\Filesystem\File;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -380,6 +380,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_admin/sql/updates/mysql/4.3.0-2023-03-10.sql',
'/administrator/components/com_admin/sql/updates/mysql/4.3.0-2023-03-28.sql',
'/administrator/components/com_admin/sql/updates/mysql/4.3.0-2023-03-29.sql',
'/administrator/components/com_admin/sql/updates/mysql/4.3.2-2023-03-31.sql',
'/administrator/components/com_admin/sql/updates/mysql/4.3.2-2023-05-03.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-03-05.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql',
Expand Down Expand Up @@ -439,6 +441,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_admin/sql/updates/postgresql/4.3.0-2023-03-10.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.3.0-2023-03-28.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.3.0-2023-03-29.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.3.2-2023-03-31.sql',
'/administrator/components/com_admin/sql/updates/postgresql/4.3.2-2023-05-03.sql',
'/libraries/src/Schema/ChangeItem/SqlsrvChangeItem.php',
'/libraries/vendor/beberlei/assert/LICENSE',
'/libraries/vendor/beberlei/assert/lib/Assert/Assert.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ public function &getInfo(): array
*/
public function phpinfoEnabled(): bool
{
return !\in_array('phpinfo', explode(',', ini_get('disable_functions')));
// remove any spaces from the ini value before exploding it
$disabledFunctions = str_replace(' ', '', ini_get('disable_functions'));
return !\in_array('phpinfo', explode(',', $disabledFunctions));
}

/**
Expand Down
35 changes: 35 additions & 0 deletions administrator/components/com_banners/src/Model/BannerModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Table\TableInterface;
use Joomla\CMS\Versioning\VersionableModelTrait;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;
use Joomla\Database\ParameterType;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -64,6 +66,34 @@ class BannerModel extends AdminModel
'language_id' => 'batchLanguage',
];

/**
* Data cleanup after batch copying data
*
* @param TableInterface $table The table object containing the newly created item
* @param integer $newId The id of the new item
* @param integer $oldId The original item id
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId)
{
// Initialise clicks and impmade
$db = $this->getDatabase();

$query = $db->getQuery(true)
->update($db->quoteName('#__banners'))
->set($db->quoteName('clicks') . ' = 0')
->set($db->quoteName('impmade') . ' = 0')
->where($db->quoteName('id') . ' = :newId')
->bind(':newId', $newId, ParameterType::INTEGER);

$db->setQuery($query);
$db->execute();
}


/**
* Batch client changes for a group of banners.
*
Expand Down Expand Up @@ -429,6 +459,11 @@ public function save($data)
$data['state'] = 0;
}

if ($input->get('task') == 'save2copy' || $input->get('task') == 'copy') {
$data['clicks'] = 0;
$data['impmade'] = 0;
}

return parent::save($data);
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/tmpl/banner/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

?>

<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="banner-form" aria-label="<?php echo Text::_('COM_BANNERS_BANNER_FORM_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate">
<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="banner-form" aria-label="<?php echo Text::_('COM_BANNERS_BANNER_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate">

<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

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

$published = $this->state->get('filter.published');
$published = (int) $this->state->get('filter.published');
?>


Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_banners/tmpl/client/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

?>

<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="client-form" aria-label="<?php echo Text::_('COM_BANNERS_CLIENT_FORM_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate">
<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="client-form" aria-label="<?php echo Text::_('COM_BANNERS_CLIENT_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate">

<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function display($tpl = null): void
throw new GenericDataException(implode("\n", $errors), 500);
}

if (!\count($this->data)) {
if (!\count($this->data) && $this->state->get('filter.search') === '') {
$this->setLayout('emptystate');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function addToolbar()
// Need to load the menu language file as mod_menu hasn't been loaded yet.
$lang = Factory::getLanguage();
$lang->load($component, JPATH_BASE)
|| $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component);
|| $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component);

// Get the results for each action.
$canDo = $this->canDo;
Expand Down Expand Up @@ -189,8 +189,7 @@ protected function addToolbar()
. ' ' . substr($component, 4) . ($section ? "-$section" : '') . '-category-' . ($isNew ? 'add' : 'edit')
);

// For new records, check the create permission.
if ($isNew && (count($user->getAuthorisedCategories($component, 'core.create')) > 0)) {
if ($isNew) {
$toolbar->apply('category.apply');
$saveGroup = $toolbar->dropdownButton('save-group');

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_contact/forms/category.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<help key="Contacts:_New_or_Edit_Category" />
<help key="Contacts:_Edit_Category" />
<listhelp key="Contacts:_Categories" />
</form>
14 changes: 4 additions & 10 deletions administrator/components/com_contact/src/Service/HTML/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\User\UserFactoryAwareTrait;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
use Joomla\Registry\Registry;
Expand All @@ -31,14 +32,7 @@
*/
class Icon
{
/**
* The user factory
*
* @var UserFactoryInterface
*
* @since 4.2.0
*/
private $userFactory;
use UserFactoryAwareTrait;

/**
* Service constructor
Expand All @@ -49,7 +43,7 @@ class Icon
*/
public function __construct(UserFactoryInterface $userFactory)
{
$this->userFactory = $userFactory;
$this->setUserFactory($userFactory);
}

/**
Expand Down Expand Up @@ -126,7 +120,7 @@ public function edit($contact, $params, $attribs = [], $legacy = false)
&& !is_null($contact->checked_out)
&& $contact->checked_out !== $user->get('id')
) {
$checkoutUser = $this->userFactory->loadUserById($contact->checked_out);
$checkoutUser = $this->getUserFactory()->loadUserById($contact->checked_out);
$date = HTMLHelper::_('date', $contact->checked_out_time);
$tooltip = Text::sprintf('COM_CONTACT_CHECKED_OUT_BY', $checkoutUser->name)
. ' <br> ' . $date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,6 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo, $user) {
}

$toolbar->divider();
$toolbar->help('Contacts:_New_or_Edit');
$toolbar->help('Contacts:_Edit');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Layout\LayoutHelper;

$published = $this->state->get('filter.published');
$published = (int) $this->state->get('filter.published');
$noUser = true;
?>

Expand Down
12 changes: 12 additions & 0 deletions administrator/components/com_content/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@
type="number"
label="JGLOBAL_SHOW_READMORE_LIMIT_LABEL"
filter="integer"
validate="number"
min="0"
default="100"
showon="show_readmore:1[AND]show_readmore_title:1"
/>
Expand Down Expand Up @@ -416,6 +418,8 @@
type="number"
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
filter="integer"
validate="number"
min="0"
default="10"
showon="save_history:1"
/>
Expand Down Expand Up @@ -723,6 +727,8 @@
type="number"
label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL"
filter="integer"
validate="number"
min="0"
default="1"
/>

Expand All @@ -738,6 +744,8 @@
type="number"
label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL"
filter="integer"
validate="number"
min="0"
default="4"
/>

Expand All @@ -754,6 +762,8 @@
type="number"
label="JGLOBAL_NUM_COLUMNS_LABEL"
filter="integer"
validate="number"
min="0"
default="1"
/>

Expand All @@ -773,6 +783,8 @@
type="number"
label="JGLOBAL_NUM_LINKS_LABEL"
filter="integer"
validate="number"
min="0"
default="4"
/>

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_content/forms/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form>
<help key="Articles:_New_or_Edit_Category" />
<help key="Articles:_Edit_Category" />
<listhelp key="Articles:_Categories" />
<fields name="params" addfieldprefix="Joomla\Component\Content\Administrator\Field">
<fieldset name="workflow" label="COM_CONTENT_WORKFLOW">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Joomla! Content Management System
*
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Content\Administrator\Event\Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo) {
$toolbar->cancel('field.cancel');
}

$toolbar->help('Component:_New_or_Edit_Field');
$toolbar->help('Fields:_Edit');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,6 @@ protected function addToolbar()
$toolbar->preferences($component);
}

$toolbar->help('Component:_Fields');
$toolbar->help('Fields');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo) {
$toolbar->cancel('group.cancel');
}

$toolbar->help('Component:_New_or_Edit_Field_Group');
$toolbar->help('Field_Groups:_Edit');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,6 @@ protected function addToolbar()
$toolbar->preferences($component);
}

$toolbar->help('Component:_Field_Groups');
$toolbar->help('Field_Groups');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @subpackage com_finder
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Finder\Administrator\Helper;
Expand Down
26 changes: 20 additions & 6 deletions administrator/components/com_finder/src/Indexer/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,15 @@ private function tokenizeToDbShort($input, $context, $lang, $format, $count)
*/
protected function toggleTables($memory)
{
static $supported = true;

if (!$supported) {
return true;
}

if (strtolower($this->db->getServerType()) != 'mysql') {
$supported = false;

return true;
}

Expand All @@ -977,13 +985,19 @@ protected function toggleTables($memory)

// Check if we are setting the tables to the Memory engine.
if ($memory === true && $state !== true) {
// Set the tokens table to Memory.
$db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens') . ' ENGINE = MEMORY');
$db->execute();
try {
// Set the tokens table to Memory.
$db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens') . ' ENGINE = MEMORY');
$db->execute();

// Set the tokens aggregate table to Memory.
$db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens_aggregate') . ' ENGINE = MEMORY');
$db->execute();
// Set the tokens aggregate table to Memory.
$db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens_aggregate') . ' ENGINE = MEMORY');
$db->execute();
} catch (\RuntimeException $e) {
$supported = false;

return true;
}

// Set the internal state.
$state = $memory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class TourModel extends AdminModel
*/
public function save($data)
{
$input = Factory::getApplication()->input;
$input = Factory::getApplication()->getInput();

// Language keys must include GUIDEDTOUR to prevent save issues
if (strpos($data['description'], 'GUIDEDTOUR') !== false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
Factory::getApplication()->input->set('hidemainmenu', true);
Factory::getApplication()->getInput()->set('hidemainmenu', true);

$user = $this->getCurrentUser();
$userId = $user->id;
Expand Down
Loading

0 comments on commit 0b5f709

Please sign in to comment.