Skip to content

Commit

Permalink
Merge branch '3.10-dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
tonypartridge committed Dec 6, 2021
2 parents a600455 + cbde13f commit d1afb08
Show file tree
Hide file tree
Showing 96 changed files with 894 additions and 570 deletions.
29 changes: 1 addition & 28 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -695,35 +695,8 @@ steps:
from_secret: github_token
HTTP_ROOT: https://ci.joomla.org/artifacts

---
kind: pipeline
name: Rips

platform:
os: linux
arch: amd64

steps:
- name: analysis310x
image: rips/rips-cli:3.2.2
commands:
- export RIPS_BASE_URI='https://api.rips.joomla.org'
- rips-cli rips:list --table=scans --parameter filter='{"__and":[{"__lessThan":{"percent":100}}]}'
- rips-cli rips:scan:start --progress --application=3 --threshold=0 --path=$(pwd) --remove-code --remove-upload --tag=$DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; }
environment:
RIPS_EMAIL:
from_secret: RIPS_EMAIL
RIPS_PASSWORD:
from_secret: RIPS_PASSWORD
when:
branch:
- 3.10-dev
repo:
- joomla/joomla-cms
- joomla/cms-security

---
kind: signature
hmac: 5692462a9c53cd5937db302a216ba95f3367ff58c2269565a215587198352276
hmac: 3c5994d3c3278a6443da81dbed98b9f3d0abfdfa1dba4c1f20a2372bb6c3cfa5

...
38 changes: 38 additions & 0 deletions .github/workflows/cacert-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Cron to update Mozilla CaCert files in the Joomla Core

on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
# Runs on the first day of every month at 03:00
- cron: '0 3 1 * *'

jobs:
build:
if: (github.event_name == 'schedule' && github.repository == 'joomla/joomla-cms') || (github.event_name != 'schedule')

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: 3.10-dev

- name: Download the latest cacert file
uses: wei/wget@v1
with:
args: -O libraries/src/Http/Transport/cacert.pem https://curl.se/ca/cacert.pem

- name: Copy the cacert file to the FOF repo
run: cp "libraries/src/Http/Transport/cacert.pem" "libraries/fof/download/adapter/cacert.pem"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
with:
branch: mozilla_ca_update

- name: Log resulting Pull Request
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,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
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function allowEdit($data = array(), $key = 'parent_id')
*
* @return boolean True if successful, false otherwise.
*
* @since __DEPLOY_VERSION__
* @since 3.10.3
*/
public function save($key = null, $urlVar = null)
{
Expand All @@ -134,7 +134,7 @@ public function save($key = null, $urlVar = null)
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since __DEPLOY_VERSION__
* @since 3.10.3
*/
public function cancel($key = null)
{
Expand Down
28 changes: 17 additions & 11 deletions administrator/components/com_categories/models/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
*/
class CategoriesModelCategories extends JModelList
{
/**
* Does an association exist? Caches the result of getAssoc().
*
* @var boolean|null
* @since 3.10.4
*/
private $hasAssociation;

/**
* Constructor.
*
Expand Down Expand Up @@ -183,9 +191,9 @@ protected function getListQuery()
->join('LEFT', '#__users AS ua ON ua.id = a.created_user_id');

// Join over the associations.
$assoc = $this->getAssoc();
$this->hasAssociation = $this->getAssoc();

if ($assoc)
if ($this->hasAssociation)
{
$query->select('COUNT(asso2.id)>1 as association')
->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_categories.item'))
Expand Down Expand Up @@ -313,33 +321,31 @@ protected function getListQuery()
*/
public function getAssoc()
{
static $assoc = null;

if (!is_null($assoc))
if (!is_null($this->hasAssociation))
{
return $assoc;
return $this->hasAssociation;
}

$extension = $this->getState('filter.extension');

$assoc = JLanguageAssociations::isEnabled();
$this->hasAssociation = JLanguageAssociations::isEnabled();
$extension = explode('.', $extension);
$component = array_shift($extension);
$cname = str_replace('com_', '', $component);

if (!$assoc || !$component || !$cname)
if (!$this->hasAssociation || !$component || !$cname)
{
$assoc = false;
$this->hasAssociation = false;
}
else
{
$hname = $cname . 'HelperAssociation';
JLoader::register($hname, JPATH_SITE . '/components/' . $component . '/helpers/association.php');

$assoc = class_exists($hname) && !empty($hname::$category_association);
$this->hasAssociation = class_exists($hname) && !empty($hname::$category_association);
}

return $assoc;
return $this->hasAssociation;
}

/**
Expand Down
26 changes: 16 additions & 10 deletions administrator/components/com_categories/models/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ class CategoriesModelCategory extends JModelAdmin
*/
protected $associationsContext = 'com_categories.item';

/**
* Does an association exist? Caches the result of getAssoc().
*
* @var boolean|null
* @since 3.10.4
*/
private $hasAssociation;

/**
* Override parent constructor.
*
Expand Down Expand Up @@ -185,7 +193,7 @@ public function getItem($pk = null)
// Convert the metadata field to an array.
$registry = new Registry($result->metadata);
$result->metadata = $registry->toArray();

if (!empty($result->id))
{
$result->tags = new JHelperTags;
Expand Down Expand Up @@ -1329,32 +1337,30 @@ protected function generateNewTitle($parentId, $alias, $title)
*/
public function getAssoc()
{
static $assoc = null;

if (!is_null($assoc))
if (!is_null($this->hasAssociation))
{
return $assoc;
return $this->hasAssociation;
}

$extension = $this->getState('category.extension');

$assoc = JLanguageAssociations::isEnabled();
$this->hasAssociation = JLanguageAssociations::isEnabled();
$extension = explode('.', $extension);
$component = array_shift($extension);
$cname = str_replace('com_', '', $component);

if (!$assoc || !$component || !$cname)
if (!$this->hasAssociation || !$component || !$cname)
{
$assoc = false;
$this->hasAssociation = false;
}
else
{
$hname = $cname . 'HelperAssociation';
JLoader::register($hname, JPATH_SITE . '/components/' . $component . '/helpers/association.php');

$assoc = class_exists($hname) && !empty($hname::$category_association);
$this->hasAssociation = class_exists($hname) && !empty($hname::$category_association);
}

return $assoc;
return $this->hasAssociation;
}
}
9 changes: 9 additions & 0 deletions administrator/components/com_fields/models/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@
class="input-xxlarge"
size="40"
/>

<field
name="value_render_class"
type="textarea"
label="COM_FIELDS_FIELD_VALUE_RENDER_CLASS_LABEL"
description="COM_FIELDS_FIELD_VALUE_RENDER_CLASS_DESC"
class="input-xxlarge"
size="40"
/>

<field
name="showlabel"
Expand Down
59 changes: 59 additions & 0 deletions administrator/components/com_joomlaupdate/models/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -1799,4 +1799,63 @@ protected function translateExtensionName(&$item)
// Translate the extension name if possible
$item->name = strip_tags(JText::_($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') . ' = ' . $db->q($template)
);

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

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

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

$menu = false;

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

$query->select(
'COUNT(*)'
)->from(
$db->qn('#__menu')
)->where(
$db->qn('template_style_id') . ' IN(' . implode(',', $ids) . ')'
);

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

return $home || $menu;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
)
);

if (version_compare($this->updateInfo['latest'], '4', '>=') && $this->isBackendTemplateIsis === false)
{
JFactory::getApplication()->enqueueMessage(
JText::_(
'COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_BACKEND_TEMPLATE_USED_NOTICE'
),
'info'
);
}

?>
<h2>
<?php echo JText::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PREUPDATE_CHECK', $this->updateInfo['latest']); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function display($tpl = null)
$this->phpOptions = $model->getPhpOptions();
$this->phpSettings = $model->getPhpSettings();
$this->nonCoreExtensions = $model->getNonCoreExtensions();
$this->isBackendTemplateIsis = (bool) $model->isTemplateActive('isis');

// Disable the critical plugins check for non-major updates.
$this->nonCoreCriticalPlugins = array();
Expand Down
13 changes: 1 addition & 12 deletions administrator/components/com_tags/models/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,9 @@ public function getItem($pk = null)
$registry = new Registry($result->urls);
$result->urls = $registry->toArray();

// Convert the created and 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(JFactory::getApplication()->get('offset'));

if ((int) $result->created_time)
{
$date = new JDate($result->created_time);
$date->setTimezone($tz);
$result->created_time = $date->toSql(true);
}
else
{
$result->created_time = null;
}

if ((int) $result->modified_time)
{
$date = new JDate($result->modified_time);
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_fields.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ COM_FIELDS_FIELD_SHOWLABEL_LABEL="Show Label"
COM_FIELDS_FIELD_TYPE_DESC="The type of the field."
COM_FIELDS_FIELD_TYPE_LABEL="Type"
COM_FIELDS_FIELD_USE_GLOBAL="Use settings from Plugin"
COM_FIELDS_FIELD_VALUE_RENDER_CLASS_DESC="The class of the field value in the output."
COM_FIELDS_FIELD_VALUE_RENDER_CLASS_LABEL="Value Class"
COM_FIELDS_GROUPS_FILTER_SEARCH_DESC="Search in field group title. Prefix with ID: to search for a field group ID."
COM_FIELDS_GROUP_N_ITEMS_ARCHIVED="%d field groups archived"
COM_FIELDS_GROUP_N_ITEMS_ARCHIVED_1="%d field group archived"
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/en-GB.com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN="Unkown error"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR="Update Server error"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS="Extensions Pre-Update Check"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_NONE="No extensions installed."
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 Isis template."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_BEING_CHECKED="The system is currently checking these plugins to see if they could cause problems during the upgrade.<br><br>Please be patient while the checks are completed."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_CONFIRMATION="Do you wish to ignore the warnings about potentially incompatible plugins and to proceed with the upgrade?"
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN="Potential Upgrade Issue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_DESC="A comma separated list of the email ad
; [RELEASENEWS] URL to the release news on joomla.org
; \n Newline character. Use it to start a new line in the email.
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT="Joomla! Update available for [SITENAME] – [URL]"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by Joomla.org. It is sent automatically by your own site,\n[SITENAME] - [URL] \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: [CURVERSION]\nJoomla! version available for installation: [NEWVERSION]\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on [SITENAME] please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: [LINK]\n\nRelease News can be found here: [RELEASENEWS]\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, [SITENAME]"
PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by the Joomla! project. It is sent automatically by your own site,\n[SITENAME] - [URL] \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: [CURVERSION]\nJoomla! version available for installation: [NEWVERSION]\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on [SITENAME] please select the following link. (If the URL is not a link, copy & paste it to your browser).\n\nUpdate link: [LINK]\n\nRelease News can be found here: [RELEASENEWS]\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, [SITENAME]"
PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_LBL="Email Language"
PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_DESC="Select a language for the update notification emails. Set to Auto to send them in the site language at the time."
PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_NONE="Auto"
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/en-GB.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metafile version="3.9" client="administrator">
<name>English (en-GB)</name>
<version>3.10.3</version>
<creationDate>September 2021</creationDate>
<version>3.10.4</version>
<creationDate>November 2021</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down

0 comments on commit d1afb08

Please sign in to comment.