Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
741e775
[5.2][system tests] Do not delete tuf metadata (#44866)
SniperSister Feb 20, 2025
ec31a42
Set column alias for BannerTable, fix warning on Save As Copy (#44864)
joomdonation Feb 20, 2025
f716005
[5.2] Translation Update (#44919)
joomla-translation-bot Feb 20, 2025
64ac8c8
[5.2] PHP Deprecated: trim(): Passing null to parameter #1 ($string) …
alikon Feb 20, 2025
4b5ff87
Add border last element media breadcrumbs (#44995)
drmenzelit Feb 25, 2025
1a5ea16
[5.2] Disable compat plugin for system tests (#44997)
heelc29 Feb 25, 2025
97754e1
[cypress] Update Menu.cy.js (#45005)
brianteeman Feb 26, 2025
150f520
Update contact.xml (#44988)
Feb 26, 2025
eb1fed9
Redesign carousel implementation to reflect documentation - bug fix (…
iteidrm Feb 26, 2025
ced9cfe
[5.3] better use str_starts_with (#44998)
heelc29 Feb 26, 2025
cef42f9
[5.3] Combine multiple unset call into one call (#44983)
joomdonation Feb 26, 2025
40daa53
[5.3] Change isset($var) && multiple times to one isset call (#44982)
joomdonation Feb 26, 2025
26d8886
Simplify code using no_unneeded_control_parentheses rule (#44981)
joomdonation Feb 26, 2025
3f2caca
Improve api app code using rector rules (#44975)
joomdonation Feb 26, 2025
b7fee10
[5.3] Change list() to array destruct for libraries code (#44973)
joomdonation Feb 26, 2025
1bd1dd6
[5.3] Change list() to array destruct for modules and plugins code (#…
joomdonation Feb 26, 2025
867945a
Changes unneeded null check to ?? operator for modules and plugins (#…
joomdonation Feb 26, 2025
aae2d2b
Remove unused variable in try catch block for modules and plugins (#4…
joomdonation Feb 26, 2025
fb9aa8e
Add frontediting setting (#44978)
QuyTon Feb 26, 2025
f6a24db
Fix MailsHelper::loadTranslationFiles (#44952)
joomdonation Feb 27, 2025
45b59b6
Fix dispatcher ACl checks: ignore any non-display tasks (#44951)
SniperSister Feb 27, 2025
064c8f6
[5.2] Add legacy message to content modules (#44366)
bembelimen Feb 27, 2025
dcbaacd
[5.3] Handle fields event in EmailCloak plugin (#44923)
rdeutz Feb 27, 2025
3be1e6c
[5.3] Category View: Fix meta tag for author (#44903)
Hackwar Feb 27, 2025
87220a4
Composer update php-debugbar to 1.23.6 (#44901)
richard67 Feb 27, 2025
c3eeb32
[5.3] Make mailtemplate information available in mail template layout…
SniperSister Feb 27, 2025
576f005
[5.3] Replace calls to dirname(__FILE) with __DIR__ (#44882)
janschoenherr Feb 27, 2025
a9c5a1b
[5.3] Remove unnecessary array internal pointer resets (#44881)
janschoenherr Feb 27, 2025
c727588
Use null coalescing assignment operator for modules and plugins (#44972)
joomdonation Feb 27, 2025
1d7650b
Fix Field Group permission check (#44956)
joomdonation Feb 27, 2025
4c6bb85
[5.3] Fields batch copy category (#44943)
chmst Feb 27, 2025
2e81829
[5.x][docu] Minor sudo fix (#45031)
muhme Feb 28, 2025
6af88f5
[Cypress] PHP Backend Notice com_media/Files (#44976)
muhme Feb 28, 2025
8a17a99
[5.3] Remove unsed variable messages from enqueue messages (#42948)
chmst Feb 28, 2025
457e5f4
Merge remote-tracking branch 'upstream/5.2-dev' into 5.3-dev-upmerge-…
richard67 Feb 28, 2025
a971099
Merge pull request #45034 from richard67/5.3-dev-upmerge-2025-02-28
richard67 Feb 28, 2025
f61dca9
Merge remote-tracking branch 'upstream/5.3-dev' into 5.4-dev-upmerge-…
richard67 Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
'native_function_invocation' => ['include' => ['@compiler_optimized']],
// Adds null to type declarations when parameter have a default null value
'nullable_type_declaration_for_default_null_value' => true,
// Removes unneeded parentheses around control statements
'no_unneeded_control_parentheses' => true,
// Using isset($var) && multiple times should be done in one call.
'combine_consecutive_issets' => true,
// Calling unset on multiple items should be done in one call
'combine_consecutive_unsets' => true,
]
)
->setFinder($finder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static function getExtensionHelperClassName($extensionName)
*/
private static function getExtensionRealName($extensionName)
{
return !str_contains($extensionName, 'com_') ? $extensionName : substr($extensionName, 4);
return !str_starts_with($extensionName, 'com_') ? $extensionName : substr($extensionName, 4);
}

/**
Expand Down Expand Up @@ -593,7 +593,7 @@ public static function canCheckinItem($extensionName, $typeName, $itemId)

$userId = Factory::getUser()->id;

return ($item->{$checkedOutFieldName} == $userId || $item->{$checkedOutFieldName} == 0);
return $item->{$checkedOutFieldName} == $userId || $item->{$checkedOutFieldName} == 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ public function display($tpl = null)

// Dynamic filter form.
// This selectors doesn't have to activate the filter bar.
unset($this->activeFilters['itemtype']);
unset($this->activeFilters['language']);
unset($this->activeFilters['itemtype'], $this->activeFilters['language']);

// Remove filters options depending on selected type.
if (empty($support['state'])) {
Expand Down Expand Up @@ -249,7 +248,7 @@ protected function addToolbar()
{
$user = $this->getCurrentUser();

if (isset($this->typeName) && isset($this->extensionName)) {
if (isset($this->typeName, $this->extensionName)) {
$helper = AssociationsHelper::getExtensionHelper($this->extensionName);
$title = $helper->getTypeTitle($this->typeName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher

$this->created = Factory::getDate()->toSql();
$this->setColumnAlias('published', 'state');
$this->setColumnAlias('title', 'name');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function allowAdd($data = [])
{
$user = $this->app->getIdentity();

return ($user->authorise('core.create', $this->extension) || \count($user->getAuthorisedCategories($this->extension, 'core.create')));
return $user->authorise('core.create', $this->extension) || \count($user->getAuthorisedCategories($this->extension, 'core.create'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function checkin($ids = [])

$fields = $db->getTableColumns($tn, false);

if (!(isset($fields['checked_out']) && isset($fields['checked_out_time']))) {
if (!(isset($fields['checked_out'], $fields['checked_out_time']))) {
continue;
}

Expand Down Expand Up @@ -183,7 +183,7 @@ public function getItems()

$fields = $db->getTableColumns($tn, false);

if (!(isset($fields['checked_out']) && isset($fields['checked_out_time']))) {
if (!(isset($fields['checked_out'], $fields['checked_out_time']))) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function save($key = null, $urlVar = null)
}

// Remove the permissions rules data if user isn't allowed to edit them.
if (!$user->authorise('core.admin', $option) && isset($data['params']) && isset($data['params']['rules'])) {
if (!$user->authorise('core.admin', $option) && isset($data['params']['rules'])) {
unset($data['params']['rules']);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ public function save($data)
}

// We don't need this anymore
unset($data['option']);
unset($data['params']['rules']);
unset($data['option'], $data['params']['rules']);
}

// Load the previous Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function getContexts(): array
*/
protected function getTableNameForSection(?string $section = null)
{
return ($section === 'category' ? 'categories' : 'contact_details');
return $section === 'category' ? 'categories' : 'contact_details';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public function save($data)
$input = $app->getInput();
$filter = InputFilter::getInstance();

if (isset($data['metadata']) && isset($data['metadata']['author'])) {
if (isset($data['metadata']['author'])) {
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static function getLookupValue($lookup, $value)
{
$result = false;

if (isset($lookup->sourceColumn) && isset($lookup->targetTable) && isset($lookup->targetColumn) && isset($lookup->displayColumn)) {
if (isset($lookup->sourceColumn, $lookup->targetTable, $lookup->targetColumn, $lookup->displayColumn)) {
$db = Factory::getDbo();
$value = (int) $value;
$query = $db->getQuery(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function display($tpl = null)
$parts = explode('.', $dashboard);
$component = $parts[0];

if (!str_contains($component, 'com_')) {
if (!str_starts_with($component, 'com_')) {
$component = 'com_' . $component;
}

Expand Down
23 changes: 22 additions & 1 deletion administrator/components/com_fields/src/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function save($data)
*/
if (
$field && \in_array($field->type, ['list', 'checkboxes', 'radio'], true)
&& isset($data['fieldparams']['options']) && isset($field->fieldparams['options'])
&& isset($data['fieldparams']['options'], $field->fieldparams['options'])
) {
$oldParams = $this->getParams($field->fieldparams['options']);
$newParams = $this->getParams($data['fieldparams']['options']);
Expand Down Expand Up @@ -1168,6 +1168,16 @@ protected function batchCopy($value, $pks, $contexts)

foreach ($pks as $pk) {
if ($user->authorise('core.create', $component . '.fieldgroup.' . $value)) {
// Find all assigned categories to this field
$db = $this->getDatabase();
$query = $db->getQuery(true);

$query->select($db->quoteName('category_id'))
->from($db->quoteName('#__fields_categories'))
->where($db->quoteName('field_id') . ' = ' . (int) $pk);

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

$table->reset();
$table->load($pk);

Expand All @@ -1194,6 +1204,17 @@ protected function batchCopy($value, $pks, $contexts)
// Get the new item ID
$newId = $table->id;

// Inset the assigned categories
if (!empty($assignedCatIds)) {
$tuple = new \stdClass();
$tuple->field_id = $newId;

foreach ($assignedCatIds as $catId) {
$tuple->category_id = $catId;
$db->insertObject('#__fields_categories', $tuple);
}
}

// Add the new ID to the array
$newIds[$pk] = $newId;
} else {
Expand Down
19 changes: 11 additions & 8 deletions administrator/components/com_fields/src/Model/GroupModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,13 @@ public function getForm($data = [], $loadData = true)
return false;
}

// Modify the form based on Edit State access controls.
if (empty($data['context'])) {
$data['context'] = $context;
}
$record = new \stdClass();
$record->context = $context;
$record->id = $jinput->get('id');

$user = $this->getCurrentUser();

if (!$user->authorise('core.edit.state', $context . '.fieldgroup.' . $jinput->get('id'))) {
if (!$this->canEditState($record)) {
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('state', 'disabled', 'true');
Expand Down Expand Up @@ -160,7 +159,9 @@ protected function canDelete($record)
return false;
}

return $this->getCurrentUser()->authorise('core.delete', $record->context . '.fieldgroup.' . (int) $record->id);
$component = explode('.', $record->context)[0];

return $this->getCurrentUser()->authorise('core.delete', $component . '.fieldgroup.' . (int) $record->id);
}

/**
Expand All @@ -177,13 +178,15 @@ protected function canEditState($record)
{
$user = $this->getCurrentUser();

$component = explode('.', $record->context)[0];

// Check for existing fieldgroup.
if (!empty($record->id)) {
return $user->authorise('core.edit.state', $record->context . '.fieldgroup.' . (int) $record->id);
return $user->authorise('core.edit.state', $component . '.fieldgroup.' . (int) $record->id);
}

// Default to component settings.
return $user->authorise('core.edit.state', $record->context);
return $user->authorise('core.edit.state', $component);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function loadChangelog()

$output = $model->loadChangelog($eid, $source);

echo (new JsonResponse($output));
echo new JsonResponse($output);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_joomlaupdate/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ function setHugeMemoryLimit()
@unlink($basePath . 'update.php');

// Import a custom finalisation file
$filename = \dirname(__FILE__) . '/finalisation.php';
$filename = __DIR__ . '/finalisation.php';

if (file_exists($filename)) {
clearFileInOPCache($filename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1415,9 +1415,7 @@ public function getNonCoreExtensions()
$decode = json_decode($extension->manifest_cache);

// Remove unused fields so they do not cause javascript errors during pre-update check
unset($decode->description);
unset($decode->copyright);
unset($decode->creationDate);
unset($decode->description, $decode->copyright, $decode->creationDate);

$this->translateExtensionName($extension);
$extension->version
Expand Down Expand Up @@ -1476,9 +1474,7 @@ public function getNonCorePlugins($folderFilter = ['system', 'user', 'authentica
$decode = json_decode($plugin->manifest_cache);

// Remove unused fields so they do not cause javascript errors during pre-update check
unset($decode->description);
unset($decode->copyright);
unset($decode->creationDate);
unset($decode->description, $decode->copyright, $decode->creationDate);

$this->translateExtensionName($plugin);
$plugin->version = $decode->version ?? Text::_('COM_JOOMLAUPDATE_PREUPDATE_UNKNOWN_EXTENSION_MANIFESTCACHE_VERSION');
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_mails/src/Helper/MailsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ public static function loadTranslationFiles($extension, $language = 'en-GB')
return;
}

$lang = Factory::getLanguage();
$lang = Factory::getApplication()->getLanguage();
$source = '';

switch (substr($extension, 0, 3)) {
case 'com':
default:
$source = JPATH_ADMINISTRATOR . '/components/' . $extension;

$lang->load($extension, JPATH_BASE, $language, true)
|| $lang->load($extension, JPATH_BASE . '/components/' . $extension, $language, true);
$lang->load($extension, JPATH_SITE, $language, true)
|| $lang->load($extension, JPATH_SITE . '/components/' . $extension, $language, true);

break;

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/src/Model/ItemModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ protected function loadFormData()

// Only merge if there is a session and itemId or itemid is null.
if (
isset($sessionData['id']) && isset($itemData['id']) && $sessionData['id'] === $itemData['id']
isset($sessionData['id'], $itemData['id']) && $sessionData['id'] === $itemData['id']
|| \is_null($itemData['id'])
) {
$data = array_merge($itemData, $sessionData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,7 @@ protected function getTypeOptionsFromLayouts($component, $view)

// If the view is hidden from the menu, discard it and move on to the next view.
if (!empty($menu['hidden']) && $menu['hidden'] == 'true') {
unset($xml);
unset($o);
unset($xml, $o);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ public function display($tpl = null)

// If in the frontend state and language should not activate the search tools.
if (Factory::getApplication()->isClient('site')) {
unset($this->activeFilters['state']);
unset($this->activeFilters['language']);
unset($this->activeFilters['state'], $this->activeFilters['language']);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class PostinstallHelper
*/
public function parsePath($path)
{
if (str_contains($path, 'site://')) {
if (str_starts_with($path, 'site://')) {
$path = JPATH_ROOT . str_replace('site://', '/', $path);
} elseif (str_contains($path, 'admin://')) {
} elseif (str_starts_with($path, 'admin://')) {
$path = JPATH_ADMINISTRATOR . str_replace('admin://', '/', $path);
}

Expand Down
18 changes: 10 additions & 8 deletions administrator/components/com_templates/src/Model/TemplateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ public function checkNewName()
->bind(':name', $name);
$db->setQuery($query);

return ($db->loadResult() == 0);
return $db->loadResult() == 0;
}

/**
Expand Down Expand Up @@ -2002,15 +2002,17 @@ public function child()
}

$user = $this->getCurrentUser();
unset($xml->languages);
unset($xml->media);
unset($xml->files);
unset($xml->parent);
unset($xml->inheritable);

// Remove the update parts
unset($xml->update);
unset($xml->updateservers);
unset(
$xml->languages,
$xml->media,
$xml->files,
$xml->parent,
$xml->inheritable,
$xml->update,
$xml->updateservers
);

if (isset($xml->creationDate)) {
$xml->creationDate = (new Date('now'))->format('F Y');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GroupController extends FormController
*/
protected function allowSave($data, $key = 'id')
{
return ($this->app->getIdentity()->authorise('core.admin', $this->option) && parent::allowSave($data, $key));
return $this->app->getIdentity()->authorise('core.admin', $this->option) && parent::allowSave($data, $key);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LevelController extends FormController
*/
protected function allowSave($data, $key = 'id')
{
return ($this->app->getIdentity()->authorise('core.admin', $this->option) && parent::allowSave($data, $key));
return $this->app->getIdentity()->authorise('core.admin', $this->option) && parent::allowSave($data, $key);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion administrator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
\define('_JEXEC', 1);

// Run the application - All executable code should be triggered through this file
require_once \dirname(__FILE__) . '/includes/app.php';
require_once __DIR__ . '/includes/app.php';
2 changes: 1 addition & 1 deletion administrator/modules/mod_feed/src/Helper/FeedHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getFeedData(Registry $params, FeedFactory $feed): \Joomla\CMS\Fe
// Get RSS parsed object
try {
$rssDoc = $feed->getFeed($rssurl);
} catch (\Exception $e) {
} catch (\Exception) {
return Text::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}

Expand Down
Loading