-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanups, fixes and a bit of optimizations for site/components batch #4 #12293
Cleanups, fixes and a bit of optimizations for site/components batch #4 #12293
Conversation
- com_mailto - com_newsfeeds - com_search Note: This is a single commit bundling all types of changes, since PR #12261 which had detailed commits, was rejected as a whole
components/com_mailto/controller.php
Outdated
@@ -135,7 +135,6 @@ public function send() | |||
|
|||
// Build the message to send | |||
$msg = JText::_('COM_MAILTO_EMAIL_MSG'); | |||
$link = $link; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice one! 😉
@@ -139,7 +139,7 @@ public function display($tpl = null) | |||
// Check the access to the newsfeed | |||
$levels = $user->getAuthorisedViewLevels(); | |||
|
|||
if (!in_array($item->access, $levels) or ((in_array($item->access, $levels) and (!in_array($item->category_access, $levels))))) | |||
if (!in_array($item->access, $levels) or in_array($item->access, $levels) and (!in_array($item->category_access, $levels))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not replace the and
and or
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slipped through...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also maybe you need to add one parenthisis here. not sure tough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, precedence maybe.. I mostly picked low hanging fruit.. That's possibly why this one "slipped through" 😄
I have tested this item ✅ successfully on c34e7bf This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12293. |
# Conflicts: # components/com_newsfeeds/helpers/route.php # components/com_newsfeeds/router.php # components/com_newsfeeds/views/categories/tmpl/default_items.php # components/com_newsfeeds/views/category/tmpl/default_items.php # components/com_newsfeeds/views/newsfeed/tmpl/default.php
I have tested this item ✅ successfully on 2b4d825 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12293. |
# Conflicts: # components/com_newsfeeds/helpers/route.php # components/com_newsfeeds/views/newsfeed/tmpl/default.php # components/com_newsfeeds/views/newsfeed/view.html.php
Fixed some conflicts that had occurred in the meantime. |
@@ -36,7 +36,7 @@ public function display($cachable = false, $urlparams = false) | |||
|
|||
$user = JFactory::getUser(); | |||
|
|||
if ($user->get('id') || ($this->input->getMethod() == 'POST' && $vName == 'category' )) | |||
if ($user->get('id') || ($this->input->getMethod() === 'POST' && $vName === 'category' )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra space 'category' ))
.
@@ -127,7 +127,7 @@ public function &getItem($pk = null) | |||
|
|||
// Check for published state if filter set. | |||
|
|||
if (((is_numeric($published)) || (is_numeric($archived))) && (($data->published != $published) && ($data->published != $archived))) | |||
if ((is_numeric($published) || is_numeric($archived)) && (($data->published != $published) && ($data->published != $archived))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change (($data->published != $published) && ($data->published != $archived))
to $data->published != $published && $data->published != $archived
.
components/com_newsfeeds/router.php
Outdated
@@ -58,20 +58,18 @@ public function build(&$query) | |||
} | |||
|
|||
// Are we dealing with a newsfeed that is attached to a menu item? | |||
if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id'])) | |||
if (isset($query['view'], $query['id']) && ($mView == $query['view']) && ($mId == (int) $query['id'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change && ($mView == $query['view']) && ($mId == (int) $query['id'])
to && $mView == $query['view'] && $mId == (int) $query['id']
.
@@ -20,9 +20,9 @@ | |||
<?php else : ?> | |||
|
|||
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT, 'UTF-8'); ?>" method="post" name="adminForm" id="adminForm"> | |||
<?php if ((($this->params->get('filter_field') != 'hide') || ($this->params->get('filter_field') != '0')) || $this->params->get('show_pagination_limit')) :?> | |||
<?php if ((($this->params->get('filter_field') !== 'hide') || ($this->params->get('filter_field') != '0')) || $this->params->get('show_pagination_limit')) :?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses.
<fieldset class="filters btn-toolbar"> | ||
<?php if (($this->params->get('filter_field') != 'hide') || ($this->params->get('filter_field') != '0')) :?> | ||
<?php if (($this->params->get('filter_field') !== 'hide') || ($this->params->get('filter_field') != '0')) :?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove parentheses
|
||
if ($lang->isRtl() && $myrtl == 0) | ||
$isRtl= $lang->isRtl(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align =
# Conflicts: # components/com_newsfeeds/views/category/tmpl/default_items.php # components/com_search/controller.php # components/com_search/views/search/view.html.php
- Some more changes in updated stuff
I have tested this item ✅ successfully on 6cc4c65 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12293. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question with strict compare a integer type with mixed(?) type. please check
the rest seems fine
components/com_newsfeeds/router.php
Outdated
{ | ||
return $child->id; | ||
} | ||
} | ||
else | ||
{ | ||
if ($child->id == (int) $segment) | ||
if ($child->id === (int) $segment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure the categories child id is a integer?
see https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/categories/categories.php#L722 for instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. Will check. According to the property's docblock it is an integer, but I am not sure if we can trust that. See: https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/categories/categories.php#L395
I have tested this item ✅ successfully on 5b88330 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12293. |
@franz-wohlkoenig RTC please , thank you |
RTC after two successful tests. |
Note: This is a single commit bundling all types of changes, since PR #12261 which had detailed commits, was rejected as a whole