Skip to content

Commit

Permalink
Merge branch '4.1-dev' into j4/server/timing
Browse files Browse the repository at this point in the history
  • Loading branch information
bembelimen committed Jan 23, 2022
2 parents 976ce29 + 81175d3 commit c494762
Show file tree
Hide file tree
Showing 63 changed files with 217 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static function getItem($extensionName, $typeName, $itemId)
{
if (!self::hasSupport($extensionName))
{
return array();
return null;
}

// Get the extension specific helper method
Expand Down Expand Up @@ -176,7 +176,7 @@ private static function loadHelper($extensionName)
*
* @param string $extensionName The extension name with com_
*
* @return boolean
* @return string
*
* @since 3.7.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ protected function loadFormData()
if (!$data->id)
{
// Check for which extension the Category Manager is used and get selected fields
$extension = substr($app->getUserState('com_categories.categories.filter.extension'), 4);
$extension = substr($app->getUserState('com_categories.categories.filter.extension', ''), 4);
$filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter');

$data->set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function display($tpl = null)

if (!$component->enabled)
{
return false;
return;
}

$form = $this->get('form');
Expand All @@ -76,7 +76,7 @@ public function display($tpl = null)
{
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');

return false;
return;
}

$this->fieldsets = $form ? $form->getFieldsets() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AdministratorService
*
* @return string The language HTML
*
* @throws Exception
* @throws \Exception
*/
public function association($contactid)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Date\Date;
use Joomla\CMS\Event\AbstractEvent;
use Joomla\CMS\Factory;
use Joomla\CMS\Filter\InputFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function __construct($config = array())
* @param array $data data
* @param boolean $loadData load current data
*
* @return Form|null The \JForm object or null if the form can't be found
* @return \Joomla\CMS\Form\Form|null The Form object or null if the form can't be found
*
* @since 3.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ public function onCustomFieldsPrepareField($context, $item, $field)
// Get the path for the layout file
$path = PluginHelper::getLayoutPath('fields', $this->_name, $field->type);

if (!file_exists($path))
{
$path = PluginHelper::getLayoutPath('fields', $this->_name, $field->type);
}

// Render the layout
ob_start();
include $path;
Expand Down Expand Up @@ -269,8 +264,8 @@ public function onContentPrepareForm(Form $form, $data)
/**
* Returns the path of the XML definition file for the field parameters
*
* @param Form $form The form
* @param stdClass $data The data
* @param Form $form The form
* @param \stdClass $data The data
*
* @return string
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function getGroups()
}
catch (\RuntimeException $e)
{
return;
return [];
}

// Build the grouped list array.
Expand Down
3 changes: 0 additions & 3 deletions administrator/components/com_finder/src/Indexer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ protected function processString($input, $lang, $mode)

// Adjust the loop.
$i += 2;
continue;
}
// Handle the OR operator.
elseif ($op === 'OR' && isset($terms[$i + 2]))
Expand Down Expand Up @@ -1124,7 +1123,6 @@ protected function processString($input, $lang, $mode)

// Adjust the loop.
$i += 2;
continue;
}
}
// Handle an orphaned OR operator.
Expand Down Expand Up @@ -1172,7 +1170,6 @@ protected function processString($input, $lang, $mode)

// Adjust the loop.
$i++;
continue;
}
// Handle the NOT operator.
elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators, true) === 'NOT')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ public function find()
if ($disabledUpdateSites)
{
$updateSitesUrl = Route::_('index.php?option=com_installer&view=updatesites');
$this->setMessage(Text::sprintf('COM_INSTALLER_MSG_UPDATE_SITES_COUNT_CHECK', $updateSitesUrl), 'warning');
$this->app->enqueueMessage(Text::sprintf('COM_INSTALLER_MSG_UPDATE_SITES_COUNT_CHECK', $updateSitesUrl), 'warning');
}

$model->findUpdates(0, $cache_timeout, $minimum_stability);

if (0 === $model->getTotal())
{
$this->setMessage(Text::_('COM_INSTALLER_MSG_UPDATE_NOUPDATES'), 'info');
$this->app->enqueueMessage(Text::_('COM_INSTALLER_MSG_UPDATE_NOUPDATES'), 'info');
}

$this->setRedirect(Route::_('index.php?option=com_installer&view=update', false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ public function removePackageFiles()

foreach ($files as $file)
{
if (File::exists($file))
if ($file !== null && File::exists($file))
{
File::delete($file);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ public function getData()
&& stripos($installedLanguage->language, $search) === false)
{
unset($installedLanguages[$key]);
continue;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_mails/forms/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
name="htmlbody"
type="editor"
label="COM_MAILS_FIELD_HTMLBODY_LABEL"
buttons="false"
buttons="true"
hide="fields,pagebreak,readmore,module"
class="inputbox"
filter="JComponentHelper::filterText"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
@dblclick="openPreview()"
@mouseleave="hideActions()"
>
<div class="media-browser-item-preview">
<div class="media-browser-item-preview"
:title="item.name">
<div class="image-background">
<div
class="image-cropped"
:style="{ backgroundImage: getHashedURL }"
/>
</div>
</div>
<div class="media-browser-item-info">
<div class="media-browser-item-info"
:title="item.name">
{{ item.name }} {{ item.filetype }}
</div>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function createFolder(string $name, string $path): string;
*
* @param string $name The name
* @param string $path The folder
* @param binary $data The data
* @param string $data The data
*
* @return string
*
Expand All @@ -118,7 +118,7 @@ public function createFile(string $name, string $path, $data): string;
*
* @param string $name The name
* @param string $path The folder
* @param binary $data The data
* @param string $data The data
*
* @return void
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DisplayController extends BaseController
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for view. Optional.
*
* @return \Joomla\CMS\MVC\View\AbstractView Reference to the view or an error.
* @return \Joomla\CMS\MVC\View\ViewInterface Reference to the view or an error.
*
* @since 3.0
* @throws \Exception
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_media/src/Model/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function createFolder($adapter, $name, $path, $override)
* @param string $adapter The adapter
* @param string $name The name
* @param string $path The folder
* @param binary $data The data
* @param string $data The data
* @param boolean $override Should the file being overridden when it exists
*
* @return string
Expand Down Expand Up @@ -286,7 +286,7 @@ public function createFile($adapter, $name, $path, $data, $override)
* @param string $adapter The adapter
* @param string $name The name
* @param string $path The folder
* @param binary $data The data
* @param string $data The data
*
* @return void
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MenuOrderingField extends ListField
* Method to get the list of siblings in a menu.
* The method requires that parent be set.
*
* @return array The field option objects or false if the parent field has not been set
* @return array|boolean The field option objects or false if the parent field has not been set
*
* @since 1.7
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static function getMenuTypes($clientId = 0)
* @param array $languages Optional array of specify which languages we want to filter
* @param int $clientId Optional client id - viz 0 = site, 1 = administrator, can be NULL for all (used only if menutype not given)
*
* @return array
* @return array|boolean
*
* @since 1.6
*/
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_modules/tmpl/module/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<p><?php echo $short_description; ?></p>
<?php if ($long_description) : ?>
<p class="readmore">
<a href="#" onclick="document.querySelector('#tab-description').click();">
<a href="#" onclick="document.getElementById('myTab').activateTab(document.getElementById('description'));">
<?php echo Text::_('JGLOBAL_SHOW_FULL_DESCRIPTION'); ?>
</a>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ function ($a, $b)
/**
* Prepare core files.
*
* @param string $dir The path of the directory to scan.
* @param string $element The path of the template element.
* @param stdClass $template The stdClass object of template.
* @param string $dir The path of the directory to scan.
* @param string $element The path of the template element.
* @param \stdClass $template The stdClass object of template.
*
* @return array
*
Expand Down
2 changes: 1 addition & 1 deletion administrator/modules/mod_sampledata/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<?php foreach($items as $i => $item) : ?>
<li class="list-group-item sampledata-<?php echo $item->name; ?>">
<div class="d-flex justify-content-between align-items-center">
<div class="sample-data__title me-2">
<div class="sample-data__title">
<span class="sample-data__icon icon-<?php echo $item->icon; ?> me-1" aria-hidden="true"></span>
<?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?>
</div>
Expand Down
4 changes: 0 additions & 4 deletions components/com_content/src/View/Category/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ public function display($tpl = null)
{
$this->link_items[] = $item;
}
else
{
continue;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/com_users/src/Controller/DisplayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DisplayController extends BaseController
* @param array|boolean $urlparams An array of safe URL parameters and their variable types,
* for valid values see {@link \Joomla\CMS\Filter\InputFilter::clean()}.
*
* @return static This object to support chaining.
* @return void
*
* @since 1.5
* @throws \Exception
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/src/Controller/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function edit()
/**
* Method to save a user's profile data.
*
* @return void
* @return void|boolean
*
* @since 1.6
* @throws \Exception
Expand Down
2 changes: 1 addition & 1 deletion layouts/plugins/system/privacyconsent/label.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@
}

// Add the label text and star.
$label = $link . '<span class="star">&#160;*</span>';
$label = $link . '<span class="star" aria-hidden="true">&#160;*</span>';

echo $label;
2 changes: 1 addition & 1 deletion layouts/plugins/user/terms/label.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@
}

// Add the label text and star.
$label = $link . '<span class="star">&#160;*</span>';
$label = $link . '<span class="star" aria-hidden="true">&#160;*</span>';

echo $label;
4 changes: 2 additions & 2 deletions libraries/src/Access/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ public static function getAuthorisedViewLevels($userId)
}
}

return $authorised;
return array_unique($authorised);
}

// Get all groups that the user is mapped to recursively.
Expand All @@ -1070,7 +1070,7 @@ public static function getAuthorisedViewLevels($userId)
}
}

return $authorised;
return array_unique($authorised);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Adapter/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class Adapter extends CMSObject
public function __construct($basepath, $classprefix = null, $adapterfolder = null)
{
$this->_basepath = $basepath;
$this->_classprefix = $classprefix ? $classprefix : 'J';
$this->_adapterfolder = $adapterfolder ? $adapterfolder : 'adapters';
$this->_classprefix = $classprefix ?: 'J';
$this->_adapterfolder = $adapterfolder ?: 'adapters';

$this->_db = Factory::getDbo();
}
Expand Down
2 changes: 0 additions & 2 deletions libraries/src/Application/ApplicationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ public static function getClientInfo($id = null, $byName = false)
}
}
}

return;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,6 @@ public function setUserState($key, $value)
{
return $registry->set($key, $value);
}

return;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Document/FeedDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function render($cache = false, $params = array())
$type = CmsFactory::getApplication()->input->get('type', 'rss');

// Instantiate feed renderer and set the mime encoding
$renderer = $this->loadRenderer(($type) ? $type : 'rss');
$renderer = $this->loadRenderer($type ?: 'rss');

if (!($renderer instanceof DocumentRenderer))
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Document/HtmlDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public function setHeadData($data)
*
* @param array $data The document head data in array form
*
* @return HtmlDocument|null instance of $this to allow chaining or null for empty input data
* @return HtmlDocument|void instance of $this to allow chaining or void for empty input data
*
* @since 1.7.0
*/
Expand Down

0 comments on commit c494762

Please sign in to comment.