Skip to content

Commit

Permalink
Merge branch 'staging' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
tecpromotion committed Jan 11, 2020
2 parents cb07172 + 31b76ff commit b6ed269
Show file tree
Hide file tree
Showing 67 changed files with 196 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
description="COM_ACTIONLOGS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX "#__users_email_lower" ON "#__users" (lower("email"));
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_ASSOCIATIONS_FILTER_SEARCH_LABEL"
description="COM_ASSOCIATIONS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_BANNERS_BANNERS_FILTER_SEARCH_LABEL"
description="COM_BANNERS_BANNERS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_BANNERS_CLIENTS_FILTER_SEARCH_LABEL"
description="COM_BANNERS_CLIENTS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_BANNERS_TRACKS_FILTER_SEARCH_LABEL"
description="COM_BANNERS_TRACKS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_CACHE_FILTER_SEARCH_LABEL"
description="COM_CACHE_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_CATEGORIES_FILTER_SEARCH_LABEL"
description="COM_CATEGORIES_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_CHECKIN_FILTER_SEARCH_LABEL"
description="COM_CHECKIN_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand All @@ -25,7 +26,7 @@
<option value="table DESC">COM_CHECKIN_DATABASE_TABLE_DESC</option>
<option value="count ASC">COM_CHECKIN_ITEMS_TO_CHECK_IN_ASC</option>
<option value="count DESC">COM_CHECKIN_ITEMS_TO_CHECK_IN_DESC</option>
</field>
</field>
<field
name="limit"
type="limitbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_CONTACT_FILTER_SEARCH_LABEL"
description="COM_CONTACT_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
60 changes: 36 additions & 24 deletions administrator/components/com_content/models/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ protected function getListQuery()
$query->select(
$this->getState(
'list.select',
'DISTINCT a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' .
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' .
', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.modified, a.ordering, a.featured, a.language, a.hits' .
', a.publish_up, a.publish_down, a.note'
)
Expand Down Expand Up @@ -353,36 +353,48 @@ protected function getListQuery()
$query->where('a.language = ' . $db->quote($language));
}

// Filter by a single or group of tags.
$hasTag = false;
$tagId = $this->getState('filter.tag');
$tag = $this->getState('filter.tag');

if (is_numeric($tagId))
// Run simplified query when filtering by one tag.
if (\is_array($tag) && \count($tag) === 1)
{
$hasTag = true;

$query->where($db->quoteName('tagmap.tag_id') . ' = ' . (int) $tagId);
}
elseif (is_array($tagId))
{
$tagId = ArrayHelper::toInteger($tagId);
$tagId = implode(',', $tagId);

if (!empty($tagId))
{
$hasTag = true;

$query->where($db->quoteName('tagmap.tag_id') . ' IN (' . $tagId . ')');
}
$tag = $tag[0];
}

if ($hasTag)
if ($tag && \is_array($tag))
{
$query->join('LEFT', $db->quoteName('#__contentitem_tag_map', 'tagmap')
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
. ' AND ' . $db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_content.article')
$tag = ArrayHelper::toInteger($tag);

$subQuery = $db->getQuery(true)
->select('DISTINCT ' . $db->quoteName('content_item_id'))
->from($db->quoteName('#__contentitem_tag_map'))
->where(
array(
$db->quoteName('tag_id') . ' IN (' . implode(',', $tag) . ')',
$db->quoteName('type_alias') . ' = ' . $db->quote('com_content.article'),
)
);

$query->join(
'INNER',
'(' . $subQuery . ') AS ' . $db->quoteName('tagmap')
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
);
}
elseif ($tag = (int) $tag)
{
$query->join(
'INNER',
$db->quoteName('#__contentitem_tag_map', 'tagmap')
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
)
->where(
array(
$db->quoteName('tagmap.tag_id') . ' = ' . $tag,
$db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_content.article'),
)
);
}

// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_CONTENT_FILTER_SEARCH_LABEL"
description="COM_CONTENT_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_CONTENT_FILTER_SEARCH_LABEL"
description="COM_CONTENT_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<field
name="search"
type="text"
inputmode="search"
label=""
description="COM_FIELDS_FIELDS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<field
name="search"
type="text"
inputmode="search"
description="COM_FIELDS_GROUPS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
class="js-stools-search-string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_FINDER_SEARCH_FILTER_SEARCH_LABEL"
description="COM_FINDER_SEARCH_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_FINDER_INDEX_SEARCH_LABEL"
description="COM_FINDER_INDEX_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_FINDER_SEARCH_SEARCH_QUERY_LABEL"
description="COM_FINDER_SEARCH_SEARCH_QUERY_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_INSTALLER_DISCOVER_FILTER_SEARCH_LABEL"
description="COM_INSTALLER_DISCOVER_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_INSTALLER_LANGUAGES_FILTER_SEARCH_LABEL"
description="COM_INSTALLER_LANGUAGES_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_INSTALLER_MANAGE_FILTER_SEARCH_LABEL"
description="COM_INSTALLER_MANAGE_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_INSTALLER_UPDATE_FILTER_SEARCH_LABEL"
description="COM_INSTALLER_UPDATE_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_INSTALLER_UPDATESITES_FILTER_SEARCH_LABEL"
description="COM_INSTALLER_UPDATESITES_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_LANGUAGES_INSTALLED_FILTER_SEARCH_LABEL"
description="COM_LANGUAGES_INSTALLED_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="JSEARCH_FILTER"
description="COM_LANGUAGES_SEARCH_IN_TITLE"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<field
name="search"
type="text"
inputmode="search"
label="JSEARCH_FILTER"
description="COM_LANGUAGES_SEARCH_IN_TITLE"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_MENUS_ITEMS_SEARCH_FILTER_LABEL"
description="COM_MENUS_ITEMS_SEARCH_FILTER"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_MENUS_ITEMS_SEARCH_FILTER_LABEL"
description="COM_MENUS_ITEMS_SEARCH_FILTER"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_MENUS_MENUS_FILTER_SEARCH_LABEL"
description="COM_MENUS_MENUS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_MESSAGES_FILTER_SEARCH_LABEL"
description="COM_MESSAGES_SEARCH_IN_SUBJECT"
hint="JSEARCH_FILTER"
Expand Down Expand Up @@ -38,7 +39,7 @@
<option value="a.user_id_from DESC">COM_MESSAGES_HEADING_FROM_DESC</option>
<option value="a.date_time ASC">JDATE_ASC</option>
<option value="a.date_time DESC">JDATE_DESC</option>
</field>
</field>
<field
name="limit"
type="limitbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_MODULES_MODULES_FILTER_SEARCH_LABEL"
description="COM_MODULES_MODULES_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_MODULES_MODULES_FILTER_SEARCH_LABEL"
description="COM_MODULES_MODULES_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_NEWSFEEDS_FILTER_SEARCH_LABEL"
description="COM_NEWSFEEDS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
Expand Down

0 comments on commit b6ed269

Please sign in to comment.