Skip to content

Commit

Permalink
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into 4.1-dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	administrator/components/com_admin/script.php
#	administrator/components/com_categories/src/Model/CategoryModel.php
#	administrator/language/en-GB/install.xml
#	administrator/language/en-GB/langmetadata.xml
#	administrator/manifests/files/joomla.xml
#	administrator/manifests/packages/pkg_en-GB.xml
#	api/language/en-GB/install.xml
#	api/language/en-GB/langmetadata.xml
#	installation/language/en-GB/langmetadata.xml
#	language/en-GB/install.xml
#	language/en-GB/langmetadata.xml
#	libraries/src/MVC/Model/ListModel.php
#	libraries/src/Table/Table.php
#	libraries/src/Version.php
  • Loading branch information
bembelimen committed Dec 2, 2021
2 parents ea1213f + 8bcefc9 commit 40eff93
Show file tree
Hide file tree
Showing 48 changed files with 266 additions and 349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ protected function sendNotificationEmails($messages, $username, $context)
$query
->select($db->quoteName(array('u.email', 'l.extensions')))
->from($db->quoteName('#__users', 'u'))
->where($db->quoteName('u.block') . ' = 0')
->join(
'INNER',
$db->quoteName('#__action_logs_users', 'l') . ' ON ( ' . $db->quoteName('l.notify') . ' = 1 AND '
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6324,6 +6324,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/templates/system/scss/general.scss',
'/templates/system/scss/offline.scss',
'/templates/system/scss/offline_rtl.scss',
// From 4.0.4 to 4.0.5
'/media/vendor/codemirror/lib/#codemirror.js#',
);

$folders = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CategoryModel extends AdminModel
* Does an association exist? Caches the result of getAssoc().
*
* @var boolean|null
* @since 4.0.5
* @since 3.10.4
*/
private $hasAssociation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ protected function getStoreId($id = '')
$id .= ':' . $this->getState('filter.state');
$id .= ':' . $this->getState('filter.group_id');
$id .= ':' . serialize($this->getState('filter.language'));
$id .= ':' . $this->getState('filter.only_use_in_subform');

return parent::getStoreId($id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Joomla\CMS\User\UserHelper;
use Joomla\CMS\Version;
use Joomla\Database\ParameterType;
use Joomla\Utilities\ArrayHelper;

/**
* Joomla! update overview Model
Expand Down Expand Up @@ -1743,4 +1744,63 @@ protected function translateExtensionName(&$item)
// Translate the extension name if possible
$item->name = strip_tags(Text::_($item->name));
}

/**
* Checks whether a given template is active
*
* @param string $template The template name to be checked
*
* @return boolean
*
* @since 3.10.4
*/
public function isTemplateActive($template)
{
$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select(
$db->qn(
array(
'id',
'home'
)
)
)->from(
$db->qn('#__template_styles')
)->where(
$db->qn('template') . ' = :template'
)->bind(':template', $template, ParameterType::STRING);

$templates = $db->setQuery($query)->loadObjectList();

$home = array_filter(
$templates,
function ($value)
{
return $value->home > 0;
}
);

$ids = ArrayHelper::getColumn($templates, 'id');

$menu = false;

if (count($ids))
{
$query = $db->getQuery(true);

$query->select(
'COUNT(*)'
)->from(
$db->qn('#__menu')
)->whereIn(
$db->qn('template_style_id'), $ids
);

$menu = $db->setQuery($query)->loadResult() > 0;
}

return $home || $menu;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ class HtmlView extends BaseHtmlView
*/
protected $selfUpdateAvailable = false;

/**
* The default admin template for the major version of Joomla that should be used when
* upgrading to the next major version of Joomla
*
* @var string
*
* @since 4.0.0
*/
protected $defaultBackendTemplate = 'atum';

/**
* Flag if the update component itself has to be updated
*
* @var boolean True when default backend template is being used
*
* @since 4.0.0
*/
protected $isDefaultBackendTemplate = false;

/**
* A special prefix used for the emptystate layout variable
*
Expand Down Expand Up @@ -110,10 +129,12 @@ public function display($tpl = null)
$this->selfUpdateAvailable = $this->get('CheckForSelfUpdate');

// Get results of pre update check evaluations
$this->phpOptions = $this->get('PhpOptions');
$this->phpSettings = $this->get('PhpSettings');
$this->nonCoreExtensions = $this->get('NonCoreExtensions');
$nextMajorVersion = Version::MAJOR_VERSION + 1;
$model = $this->getModel();
$this->phpOptions = $this->get('PhpOptions');
$this->phpSettings = $this->get('PhpSettings');
$this->nonCoreExtensions = $this->get('NonCoreExtensions');
$this->isDefaultBackendTemplate = (bool) $model->isTemplateActive($this->defaultBackendTemplate);
$nextMajorVersion = Version::MAJOR_VERSION + 1;

// The critical plugins check is only available for major updates.
if (version_compare($this->updateInfo['latest'], (string) $nextMajorVersion, '>='))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Version;
use Joomla\Component\Joomlaupdate\Administrator\View\Joomlaupdate\HtmlView;

/** @var HtmlView $this */
Expand Down Expand Up @@ -78,6 +79,16 @@

$updatePossible = true;

if (version_compare($this->updateInfo['latest'], Version::MAJOR_VERSION + 1, '>=') && $this->isDefaultBackendTemplate === false)
{
Factory::getApplication()->enqueueMessage(
Text::sprintf(
'COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_BACKEND_TEMPLATE_USED_NOTICE',
ucfirst($this->defaultBackendTemplate)
),
'info'
);
}
?>

<div id="joomlaupdate-wrapper" class="main-card p-3 mt-3" data-joomla-target-version="<?php echo $latestJoomlaVersion; ?>" data-joomla-current-version="<?php echo $currentJoomlaVersion; ?>">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_tags/src/Model/TagModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function getItem($pk = null)
$registry = new Registry($result->urls);
$result->urls = $registry->toArray();

// Convert the modified dates to local user time for display in the form.
// Convert the modified date to local user time for display in the form.
$tz = new \DateTimeZone(Factory::getApplication()->get('offset'));

if ((int) $result->modified_time)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ protected function addToolbar()
$explodeArray = explode('.', $this->fileName);
$ext = end($explodeArray);

ToolbarHelper::title(Text::sprintf('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE', ucfirst($this->template->name)), 'paint-brush thememanager');
ToolbarHelper::title(Text::sprintf('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE', ucfirst($this->template->name)), 'icon-code thememanager');

// Only show file edit buttons for global SuperUser
if ($isSuperUser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ protected function addToolbar()
// Set the title.
if ($clientId === 1)
{
ToolbarHelper::title(Text::_('COM_TEMPLATES_MANAGER_TEMPLATES_ADMIN'), 'paint-brush thememanager');
ToolbarHelper::title(Text::_('COM_TEMPLATES_MANAGER_TEMPLATES_ADMIN'), 'icon-code thememanager');
}
else
{
ToolbarHelper::title(Text::_('COM_TEMPLATES_MANAGER_TEMPLATES_SITE'), 'paint-brush thememanager');
ToolbarHelper::title(Text::_('COM_TEMPLATES_MANAGER_TEMPLATES_SITE'), 'icon-code thememanager');
}

if ($canDo->get('core.admin') || $canDo->get('core.options'))
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_SHOW_LESS_COMPATIBILITY_INFORMATION="Le
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_SHOW_MORE_COMPATIBILITY_INFORMATION="More Details"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_UPDATE_SERVER_OFFERS_NO_COMPATIBLE_VERSION="Update Information Unavailable"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_UPDATE_SERVER_OFFERS_NO_COMPATIBLE_VERSION_NOTES="Extension does not offer a compatible version for the selected target version of Joomla. This could mean the extension does not use the Joomla update system or the developer has not provided compatibility information for this Joomla version yet."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_BACKEND_TEMPLATE_USED_NOTICE="We detected that you are not using a core admin template. You might find the upgrade process smoother if you <a href='index.php?option=com_templates&view=styles&client_id=1'>switch</a> to use the %s template."
COM_JOOMLAUPDATE_VIEW_DEFAULT_HELP="More Information"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INFOURL="Additional Information"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST="You must update to the latest version of the Joomla Update Component before you can update Joomla!"
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_modules.ini
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ COM_MODULES_POSITION_USER5="User 5"
COM_MODULES_POSITION_USER6="User 6"
COM_MODULES_POSITION_USER7="User 7"
COM_MODULES_POSITION_USER8="User 8"
COM_MODULES_SAVE_SUCCESS="Module saved"
COM_MODULES_SAVE_SUCCESS="Module saved."
COM_MODULES_SEARCH_MENUITEM="Search for a Menu Item"
COM_MODULES_SELECT_MODULE="Select module, %s"
COM_MODULES_SUBITEMS="Sub-items"
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_sampledata_blog.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ PLG_SAMPLEDATA_BLOG_STEP1_SUCCESS="Step 1: Tags, Articles, Fields and Workflow d
PLG_SAMPLEDATA_BLOG_STEP2_SUCCESS="Step 2: Menus done!"
PLG_SAMPLEDATA_BLOG_STEP3_SUCCESS="Step 3: Modules done!"
PLG_SAMPLEDATA_BLOG_STEP4_SUCCESS="Blog Sample Data has been installed!"
PLG_SAMPLEDATA_BLOG_STEP_FAILED="Step %1$u Failed: %2$s"
PLG_SAMPLEDATA_BLOG_STEP_FAILED="Step %1$u Failed with message: %2$s Please note that you can only install Blog Sample Data once."
PLG_SAMPLEDATA_BLOG_STEP_SKIPPED="Step %1$u Skipped: '%2$s' is either not installed or disabled."
PLG_SAMPLEDATA_BLOG_XML_DESCRIPTION="Provides the blog sample data. Can be installed using the sample data module."
5 changes: 3 additions & 2 deletions administrator/language/en-GB/plg_workflow_notification.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ PLG_WORKFLOW_NOTIFICATION="Workflow - Notification"
PLG_WORKFLOW_NOTIFICATION_ADDTEXT="The stage has changed"
PLG_WORKFLOW_NOTIFICATION_ADDTEXT_DESC="This text will be sent: Title [title], changed by [user], new state: [state]. You can add own text to this information. You can localise the text by using a language key and creating a language override."
PLG_WORKFLOW_NOTIFICATION_ADDTEXT_LABEL="Additional Message Text"
PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_MSG="Title: %1$s. Transition %2$s performed by %3$s. New state: %4$s."
PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_SUBJECT="The status of an %1$s has been changed"
PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_MSG="Title: %1$s. Transition \"%2$s\" performed by %3$s. New state: %4$s."
PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_SUBJECT="The status of \"%s\" has been changed"
PLG_WORKFLOW_NOTIFICATION_NO_TITLE="Unknown title"
PLG_WORKFLOW_NOTIFICATION_RECEIVERS_LABEL="Users"
PLG_WORKFLOW_NOTIFICATION_SENDMAIL_LABEL="Send Notification"
PLG_WORKFLOW_NOTIFICATION_SENT="Notifications sent"
Expand Down
60 changes: 30 additions & 30 deletions administrator/manifests/packages/pkg_search.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<extension type="package" version="4.0" method="upgrade">
<name>pkg_search</name>
<packagename>search</packagename>
<creationDate>17.08.2021</creationDate>
<packager>Joomla! Project</packager>
<copyright>(C) 2021 Open Source Matters. All rights reserved.</copyright>
<packageremail>[email protected]</packageremail>
<packagerurl>www.joomla.org</packagerurl>
<author>Joomla! Project</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>4.0.0</version>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<scriptfile>script.php</scriptfile>
<files>
<!-- The id for each extension is the element stored in the DB -->
<file type="component" id="com_search">com_search.zip</file>
<file type="module" id="mod_search" client="site">mod_search.zip</file>
<file type="plugin" id="categories" group="search">plg_search_categories.zip</file>
<file type="plugin" id="contacts" group="search">plg_search_contacts.zip</file>
<file type="plugin" id="content" group="search">plg_search_content.zip</file>
<file type="plugin" id="newsfeeds" group="search">plg_search_newsfeeds.zip</file>
<file type="plugin" id="tags" group="search">plg_search_tags.zip</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_search.sys.ini</language>
</languages>
<updateservers>
<!-- Note: No spaces or linebreaks allowed between the server tags -->
<server type="extension" name="Search Update Site">https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml</server>
</updateservers>
<name>pkg_search</name>
<packagename>search</packagename>
<creationDate>17.08.2021</creationDate>
<packager>Joomla! Project</packager>
<copyright>(C) 2021 Open Source Matters. All rights reserved.</copyright>
<packageremail>[email protected]</packageremail>
<packagerurl>www.joomla.org</packagerurl>
<author>Joomla! Project</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>4.0.0</version>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<scriptfile>script.php</scriptfile>
<files>
<!-- The id for each extension is the element stored in the DB -->
<file type="component" id="com_search">com_search.zip</file>
<file type="module" id="mod_search" client="site">mod_search.zip</file>
<file type="plugin" id="categories" group="search">plg_search_categories.zip</file>
<file type="plugin" id="contacts" group="search">plg_search_contacts.zip</file>
<file type="plugin" id="content" group="search">plg_search_content.zip</file>
<file type="plugin" id="newsfeeds" group="search">plg_search_newsfeeds.zip</file>
<file type="plugin" id="tags" group="search">plg_search_tags.zip</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_search.sys.ini</language>
</languages>
<updateservers>
<!-- Note: No spaces or linebreaks allowed between the server tags -->
<server type="extension" name="Search Update Site">https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml</server>
</updateservers>
</extension>
9 changes: 8 additions & 1 deletion build/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,14 @@ function clean_composer(string $dir)
$fullpath = $tmp . '/' . $time;

// Parse input options
$options = getopt('', ['help', 'remote::', 'exclude-zip', 'exclude-gzip', 'exclude-bzip2', 'include-zstd']);
$options = getopt('', ['help', 'remote::', 'exclude-zip', 'exclude-gzip', 'exclude-bzip2', 'include-zstd', 'disable-patch-packages']);

$remote = $options['remote'] ?? false;
$excludeZip = isset($options['exclude-zip']);
$excludeGzip = isset($options['exclude-gzip']);
$excludeBzip2 = isset($options['exclude-bzip2']);
$excludeZstd = !isset($options['include-zstd']);
$buildPatchPackages = !isset($options['disable-patch-packages']);
$showHelp = isset($options['help']);

// Disable the generation of extra text files
Expand Down Expand Up @@ -423,6 +424,12 @@ function clean_composer(string $dir)
// Count down starting with the latest release and add diff files to this array
for ($num = $release - 1; $num >= 0; $num--)
{
if (!$buildPatchPackages)
{
echo "Disabled creating patch package for $num per flag.\n";
continue;
}

echo "Create version $num update packages.\n";

// Here we get a list of all files that have changed between the two references ($previousTag and $remote) and save in diffdocs
Expand Down
Loading

0 comments on commit 40eff93

Please sign in to comment.