Skip to content

Commit

Permalink
Merge branch '5.1-dev' into patch-5
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Mar 27, 2024
2 parents 0d11e01 + d0ba16f commit a51688a
Show file tree
Hide file tree
Showing 75 changed files with 197 additions and 167 deletions.
4 changes: 2 additions & 2 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
//
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
// (See `backward_compatibility_checks` for additional options)
// Automatically inferred from composer.json requirement for "php" of "^7.2.5"
'target_php_version' => '7.2',
// Automatically inferred from composer.json requirement for "php" of "^8.1.0"
'target_php_version' => '8.1',

// If enabled, missing properties will be created when
// they are first seen. If false, we'll report an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\ClientModel;
Expand All @@ -44,7 +43,7 @@ class HtmlView extends BaseHtmlView
/**
* The active item
*
* @var CMSObject
* @var \stdClass
* @since 1.5
*/
protected $item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FieldsListPlugin extends FieldsPlugin
* @param \DOMElement $parent The field node parent.
* @param Form $form The form.
*
* @return \DOMElement
* @return ?\DOMElement
*
* @since 3.7.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function onCustomFieldsGetTypes()
* @param \stdclass $item The item.
* @param \stdclass $field The field.
*
* @return string
* @return ?string
*
* @since 3.7.0
*/
Expand Down Expand Up @@ -235,7 +235,7 @@ public function onCustomFieldsPrepareField($context, $item, $field)
* @param \DOMElement $parent The field node parent.
* @param Form $form The form.
*
* @return \DOMElement
* @return ?\DOMElement
*
* @since 3.7.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Filesystem\Path;
Expand All @@ -39,7 +38,7 @@ class HtmlView extends BaseHtmlView
protected $form;

/**
* @var CMSObject
* @var \stdClass
*
* @since 3.7.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
Expand All @@ -40,7 +39,7 @@ class HtmlView extends BaseHtmlView
protected $form;

/**
* @var CMSObject
* @var \stdClass
*
* @since 3.7.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public function start()

$output = ob_get_contents();

if ($output) {
// Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error.
if (trim($output)) {
throw new \Exception(Text::_('COM_FINDER_AN_ERROR_HAS_OCCURRED'));
}

Expand Down Expand Up @@ -201,7 +202,8 @@ public function batch()

$output = ob_get_contents();

if ($output) {
// Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error.
if (trim($output)) {
throw new \Exception(Text::_('COM_FINDER_INDEXER_ERROR_PLUGIN_FAILURE'));
}

Expand Down Expand Up @@ -251,7 +253,8 @@ public function optimize()

$output = ob_get_contents();

if ($output) {
// Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error.
if (trim($output)) {
throw new \Exception(Text::_('COM_FINDER_AN_ERROR_HAS_OCCURRED'));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

Expand Down Expand Up @@ -51,7 +50,7 @@ class HtmlView extends BaseHtmlView
/**
* The active item
*
* @var CMSObject|boolean
* @var \stdClass
*
* @since 3.6.2
*/
Expand Down
34 changes: 33 additions & 1 deletion administrator/components/com_guidedtours/src/Model/TourModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ protected function setStepsLanguage(int $id, string $language = '*'): bool
* @param int $id Id of a tour
* @param int $autostart The autostart value of a tour
*
* @since 5.0.0
* @since __DEPLOY_VERSION__
*/
public function setAutostart($id, $autostart)
{
Expand All @@ -526,4 +526,36 @@ public function setAutostart($id, $autostart)
$db->setQuery($query);
$db->execute();
}

/**
* Retrieve a tour's autostart value
*
* @param string $uid the uid of a tour
*
* @since __DEPLOY_VERSION__
*/
public function isAutostart($uid)
{
$db = $this->getDatabase();

$query = $db->getQuery(true)
->select($db->quoteName('autostart'))
->from($db->quoteName('#__guidedtours'))
->where($db->quoteName('published') . ' = 1')
->where($db->quoteName('uid') . ' = :uid')
->bind(':uid', $uid, ParameterType::STRING);

$db->setQuery($query);

try {
$result = $db->loadResult();
if ($result === null) {
return false;
}
} catch (\RuntimeException $e) {
return false;
}

return $result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HtmlView extends BaseHtmlView
/**
* The active item
*
* @var object
* @var \stdClass
*/
protected $item;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,31 @@ protected function addToolbar()
$toolbar = Toolbar::getInstance();
$canDo = ContentHelper::getActions('com_installer');

$dropdown = $toolbar->dropdownButton('status-group')
->text('JTOOLBAR_CHANGE_STATUS')
->toggleSplit(false)
->icon('icon-ellipsis-h')
->buttonClass('btn btn-action')
->listCheck(true);

$childBar = $dropdown->getChildToolbar();

if ($canDo->get('core.edit.state')) {
$toolbar->publish('manage.publish', 'JTOOLBAR_ENABLE')
$childBar->publish('manage.publish', 'JTOOLBAR_ENABLE')
->listCheck(true);
$toolbar->unpublish('manage.unpublish', 'JTOOLBAR_DISABLE')
$childBar->unpublish('manage.unpublish', 'JTOOLBAR_DISABLE')
->listCheck(true);
$toolbar->divider();
}

$toolbar->standardButton('refresh', 'JTOOLBAR_REFRESH_CACHE', 'manage.refresh')
->listCheck(true);
$toolbar->divider();

if ($canDo->get('core.delete')) {
$toolbar->delete('manage.remove', 'JTOOLBAR_UNINSTALL')
$childBar->delete('manage.remove', 'JTOOLBAR_UNINSTALL')
->message('COM_INSTALLER_CONFIRM_UNINSTALL')
->listCheck(true);
$toolbar->divider();
}

$childBar->standardButton('refresh', 'JTOOLBAR_REFRESH_CACHE', 'manage.refresh')
->listCheck(true);

if ($canDo->get('core.manage')) {
$toolbar->linkButton('upload', 'COM_INSTALLER_TOOLBAR_INSTALL_EXTENSIONS')
->url('index.php?option=com_installer&view=install');
Expand Down
5 changes: 2 additions & 3 deletions administrator/components/com_joomlaupdate/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<!-- All invalid/unsupported/obsolete options equated to default in code with 3.4.0 -->
<option value="default">COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT</option>
<option value="next">COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT</option>
<option value="testing">COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_TESTING</option>
<option value="custom">COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_CUSTOM</option>
</field>

Expand All @@ -29,7 +28,6 @@
label="COM_JOOMLAUPDATE_MINIMUM_STABILITY_LABEL"
description="COM_JOOMLAUPDATE_MINIMUM_STABILITY_DESC"
default="4"
showon="updatesource:testing[OR]updatesource:custom"
validate="options"
>
<option value="0">COM_JOOMLAUPDATE_MINIMUM_STABILITY_DEV</option>
Expand All @@ -41,11 +39,12 @@

<field
name="customurl"
type="text"
type="url"
label="COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_LABEL"
default=""
length="50"
showon="updatesource:custom"
validate="url"
/>

<field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ public function applyUpdateSite()
$params = ComponentHelper::getParams('com_joomlaupdate');

switch ($params->get('updatesource', 'default')) {
case 'testing':
// "Testing"
$updateURL = 'https://update.joomla.org/core/test/list_test.xml';
break;

case 'custom':
// "Custom"
// @todo: check if the customurl is valid and not just "not empty".
Expand All @@ -115,6 +110,7 @@ public function applyUpdateSite()
* case 'lts':
* case 'sts': (It's shown as "Default" because that option does not exist any more)
* case 'nochange':
* case 'testing':
*/
$updateURL = 'https://update.joomla.org/cms/';
}
Expand Down Expand Up @@ -173,13 +169,9 @@ public function refreshUpdates($force = false)
}

$updater = Updater::getInstance();
$minimumStability = Updater::STABILITY_STABLE;
$comJoomlaupdateParams = ComponentHelper::getParams('com_joomlaupdate');

if (\in_array($comJoomlaupdateParams->get('updatesource', 'default'), ['testing', 'custom'])) {
$minimumStability = $comJoomlaupdateParams->get('minimum_stability', Updater::STABILITY_STABLE);
}

$minimumStability = $comJoomlaupdateParams->get('minimum_stability', Updater::STABILITY_STABLE);
$reflection = new \ReflectionObject($updater);
$reflectionMethod = $reflection->getMethod('findUpdates');
$methodParameters = $reflectionMethod->getParameters();
Expand Down Expand Up @@ -296,13 +288,9 @@ public function getUpdateInformation()
return $this->updateInformation;
}

$minimumStability = Updater::STABILITY_STABLE;
$comJoomlaupdateParams = ComponentHelper::getParams('com_joomlaupdate');
$channel = $comJoomlaupdateParams->get('updatesource', 'default');

if (\in_array($channel, ['testing', 'custom'])) {
$minimumStability = $comJoomlaupdateParams->get('minimum_stability', Updater::STABILITY_STABLE);
}
$minimumStability = $comJoomlaupdateParams->get('minimum_stability', Updater::STABILITY_STABLE);

$update = new Update();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,6 @@ public function display($tpl = null)
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT');
break;

case 'testing':
// "Testing"
$this->langKey = 'COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING';
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_TESTING');
break;

case 'custom':
// "Custom"
$this->langKey = 'COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM';
Expand All @@ -259,6 +253,7 @@ public function display($tpl = null)
* case 'sts':
* case 'lts':
* case 'nochange':
* case 'testing':
*/
$this->langKey = 'COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT';
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HtmlView extends BaseHtmlView
/**
* The active item
*
* @var CMSObject
* @var \stdClass
*/
protected $item;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

Expand All @@ -42,7 +41,7 @@ class HtmlView extends BaseHtmlView
/**
* The active item
*
* @var CMSObject
* @var \stdClass
*/
protected $item;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Button\DropdownButton;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
Expand All @@ -35,7 +34,7 @@ class HtmlView extends BaseHtmlView
/**
* The list of newsfeeds
*
* @var CMSObject
* @var array
*
* @since 1.6
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

Expand All @@ -33,7 +32,7 @@ class HtmlView extends BaseHtmlView
/**
* The item object for the newsfeed
*
* @var CMSObject
* @var \stdClass
*/
protected $item;

Expand Down

0 comments on commit a51688a

Please sign in to comment.