From 9d437e23e6252c501c1a8d130fa7b92a2e7ae9a5 Mon Sep 17 00:00:00 2001
From: Tomasz Narloch
Date: Wed, 3 Jan 2018 01:09:31 +0100
Subject: [PATCH 001/255] Set active class in mod_articles_categories when SEF
is off (#19197)
* Set active class in mod_articles_categories when SEF is off
* Use a better approach
* Remove redundant white character
---
modules/mod_articles_categories/tmpl/default_items.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/mod_articles_categories/tmpl/default_items.php b/modules/mod_articles_categories/tmpl/default_items.php
index fbae85902ef57..adc8eaa3346d5 100644
--- a/modules/mod_articles_categories/tmpl/default_items.php
+++ b/modules/mod_articles_categories/tmpl/default_items.php
@@ -9,8 +9,13 @@
defined('_JEXEC') or die;
+$input = JFactory::getApplication()->input;
+$option = $input->getCmd('option');
+$view = $input->getCmd('view');
+$id = $input->getInt('id');
+
foreach ($list as $item) : ?>
- id))) echo ' class="active"'; ?>> level - $startLevel - 1; ?>
+ id && $view == 'category' && $option == 'com_content') echo ' class="active"'; ?>> level - $startLevel - 1; ?>
get('item_heading') + $levelup; ?>>
title; ?>
From 671cdc24d4271ac695b3023a35fdef8750ffc09d Mon Sep 17 00:00:00 2001
From: Tuan Pham Ngoc
Date: Wed, 3 Jan 2018 07:09:55 +0700
Subject: [PATCH 002/255] Fix warning on JHtmlMenu::treerecurse method on PHP
7.2 (#19193)
---
libraries/cms/html/menu.php | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/libraries/cms/html/menu.php b/libraries/cms/html/menu.php
index 27b982ebcc89e..5bd4d22de9a03 100644
--- a/libraries/cms/html/menu.php
+++ b/libraries/cms/html/menu.php
@@ -351,7 +351,7 @@ public static function linkOptions($all = false, $unassigned = false, $clientId
*/
public static function treerecurse($id, $indent, $list, &$children, $maxlevel = 9999, $level = 0, $type = 1)
{
- if ($level <= $maxlevel && @$children[$id])
+ if ($level <= $maxlevel && isset($children[$id]) && is_array($children[$id]))
{
if ($type)
{
@@ -379,8 +379,16 @@ public static function treerecurse($id, $indent, $list, &$children, $maxlevel =
$list[$id] = $v;
$list[$id]->treename = $indent . $txt;
- $list[$id]->children = count(@$children[$id]);
- $list = static::treerecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level + 1, $type);
+
+ if (isset($children[$id]) && is_array($children[$id]))
+ {
+ $list[$id]->children = count($children[$id]);
+ $list = static::treerecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level + 1, $type);
+ }
+ else
+ {
+ $list[$id]->children = 0;
+ }
}
}
From 5e1d013eb0251f03fbd12c87370a8d19676bc4b2 Mon Sep 17 00:00:00 2001
From: Nicola Galgano
Date: Wed, 3 Jan 2018 01:10:24 +0100
Subject: [PATCH 003/255] [install] - remove Notice: Undefined property:
stdClass::$class (#19164)
maybe not the perfect fix
---
layouts/joomla/form/field/radio.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/layouts/joomla/form/field/radio.php b/layouts/joomla/form/field/radio.php
index 82f87fdb0c5ad..040a02dd14fe0 100644
--- a/layouts/joomla/form/field/radio.php
+++ b/layouts/joomla/form/field/radio.php
@@ -64,9 +64,10 @@
$option) : ?>
value === $value) ? 'checked="checked"' : '';
- $disabled = !empty($option->disable) ? 'disabled' : '';
- $style = $disabled ? 'style="pointer-events: none"' : '';
+ $checked = ((string) $option->value === $value) ? 'checked="checked"' : '';
+ $disabled = !empty($option->disable) ? 'disabled' : '';
+ $style = $disabled ? 'style="pointer-events: none"' : '';
+ $option->class = !empty($option->class) ? $option->class : '';
$option->class = trim($option->class . ' ' . $disabled);
$optionClass = !empty($option->class) ? 'class="' . $option->class . '"' : '';
From 0dc572cabcaa7d7bb9b5c4c467e9b105af82a6f4 Mon Sep 17 00:00:00 2001
From: Brian Teeman
Date: Wed, 3 Jan 2018 00:12:00 +0000
Subject: [PATCH 004/255] Profile plugin fields can be left empty when required
on admin edit (#19141)
* Profile plugin fields can be left empty when required on admin edit
## Steps to reproduce the issue
Enable profile plugin. set fields to required for site and admin edit. We used Phone, Company, and website in our test.
## Expected result
Profile plugin fields are required during admin edit.
## Actual result
Can save profile during admin edit when profile plugin fields are empty.
After this PR the fields set to required are marked with a * and have the class required
PR for #14805
* tab
* oops
* oops (reverted from commit 3ec6bd05cf9e51acbdc9f7165cf3c692c4ecd908)
---
plugins/user/profile/profile.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/plugins/user/profile/profile.php b/plugins/user/profile/profile.php
index 3190fc9807064..ce937a32002ac 100644
--- a/plugins/user/profile/profile.php
+++ b/plugins/user/profile/profile.php
@@ -299,8 +299,13 @@ public function onContentPrepareForm($form, $data)
// Case using the users manager in admin
if ($name === 'com_users.user')
{
+ // Toggle whether the field is required.
+ if ($this->params->get('profile-require_' . $field, 1) > 0)
+ {
+ $form->setFieldAttribute($field, 'required', ($this->params->get('profile-require_' . $field) == 2) ? 'required' : '', 'profile');
+ }
// Remove the field if it is disabled in registration and profile
- if ($this->params->get('register-require_' . $field, 1) == 0
+ elseif ($this->params->get('register-require_' . $field, 1) == 0
&& $this->params->get('profile-require_' . $field, 1) == 0)
{
$form->removeField($field, 'profile');
From 20424c41baf86463f9263363f82beb2dbd849816 Mon Sep 17 00:00:00 2001
From: Ruud
Date: Wed, 3 Jan 2018 01:12:56 +0100
Subject: [PATCH 005/255] com_redirect modal close button check in fix (#19116)
* com_redirect modal close check in fix
* Add corect button type to buttons
---
.../com_redirect/views/links/tmpl/default.php | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/administrator/components/com_redirect/views/links/tmpl/default.php b/administrator/components/com_redirect/views/links/tmpl/default.php
index 6e185baa2ce04..199d0a6d2f40f 100644
--- a/administrator/components/com_redirect/views/links/tmpl/default.php
+++ b/administrator/components/com_redirect/views/links/tmpl/default.php
@@ -29,8 +29,8 @@
'bootstrap.renderModal',
'plugin' . $this->redirectPluginId . 'Modal',
array(
- 'url' => $link,
- 'title' => JText::_('COM_REDIRECT_EDIT_PLUGIN_SETTINGS'),
+ 'url' => $link,
+ 'title' => JText::_('COM_REDIRECT_EDIT_PLUGIN_SETTINGS'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
@@ -38,11 +38,12 @@
'closeButton' => false,
'backdrop' => 'static',
'keyboard' => false,
- 'footer' => ''
- . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . ' '
- . ''
+ 'footer' => ''
+ . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . ' '
+ . ''
. JText::_("JSAVE") . ' '
- . ''
+ . ''
. JText::_("JAPPLY") . ' '
)
); ?>
@@ -169,4 +170,3 @@
-
From d0688686669d344d8d0a4c87d55611eff4b74d4d Mon Sep 17 00:00:00 2001
From: Tomasz Narloch
Date: Wed, 3 Jan 2018 01:14:24 +0100
Subject: [PATCH 006/255] Do not add default or active Itemid to every link
without own menu item (#19099)
* Do not add default or active Itemid to every link without own menu item
* Allow to login when there is no menu item for login page and home page is restricted
* Correctly redirect user to preferred site language association
* Fix link for com_users login form
---
.../src/Component/Router/Rules/MenuRules.php | 20 +++----
libraries/src/Router/SiteRouter.php | 18 +-----
modules/mod_login/tmpl/default.php | 4 +-
.../system/languagefilter/languagefilter.php | 55 +++++++++++--------
templates/beez3/html/mod_login/default.php | 4 +-
templates/protostar/offline.php | 4 +-
templates/system/offline.php | 4 +-
.../rules/JComponentRouterRulesMenuTest.php | 8 +--
.../libraries/cms/router/JRouterSiteTest.php | 18 ------
9 files changed, 50 insertions(+), 85 deletions(-)
diff --git a/libraries/src/Component/Router/Rules/MenuRules.php b/libraries/src/Component/Router/Rules/MenuRules.php
index 973d01095c252..467074704f72d 100644
--- a/libraries/src/Component/Router/Rules/MenuRules.php
+++ b/libraries/src/Component/Router/Rules/MenuRules.php
@@ -156,20 +156,16 @@ public function preprocess(&$query)
}
}
- // Check if the active menuitem matches the requested language
- if ($active && $active->component === 'com_' . $this->router->getName()
- && ($language === '*' || in_array($active->language, array('*', $language)) || !\JLanguageMultilang::isEnabled()))
+ // If there is no view and task in query then add the default item id
+ if (!isset($query['view']) && !isset($query['task']))
{
- $query['Itemid'] = $active->id;
- return;
- }
-
- // If not found, return language specific home link
- $default = $this->router->menu->getDefault($language);
+ // If not found, return language specific home link
+ $default = $this->router->menu->getDefault($language);
- if (!empty($default->id))
- {
- $query['Itemid'] = $default->id;
+ if (!empty($default->id))
+ {
+ $query['Itemid'] = $default->id;
+ }
}
}
diff --git a/libraries/src/Router/SiteRouter.php b/libraries/src/Router/SiteRouter.php
index 3653222cf0006..b9845fa92e253 100644
--- a/libraries/src/Router/SiteRouter.php
+++ b/libraries/src/Router/SiteRouter.php
@@ -707,26 +707,14 @@ protected function createUri($url)
if ($itemid === null)
{
- if ($option = $uri->getVar('option'))
+ if (!$uri->getVar('option'))
{
- $item = $this->menu->getItem($this->getVar('Itemid'));
+ $option = $this->getVar('option');
- if ($item !== null && $item->component === $option)
- {
- $uri->setVar('Itemid', $item->id);
- }
- }
- else
- {
- if ($option = $this->getVar('option'))
+ if ($option)
{
$uri->setVar('option', $option);
}
-
- if ($itemid = $this->getVar('Itemid'))
- {
- $uri->setVar('Itemid', $itemid);
- }
}
}
else
diff --git a/modules/mod_login/tmpl/default.php b/modules/mod_login/tmpl/default.php
index fcd3b1c962c94..5ea82c8cbc019 100644
--- a/modules/mod_login/tmpl/default.php
+++ b/modules/mod_login/tmpl/default.php
@@ -15,7 +15,7 @@
JHtml::_('bootstrap.tooltip');
?>
-
-