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 16, 2020
2 parents b6ed269 + 2d1ea69 commit c594a37
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 54 deletions.
48 changes: 10 additions & 38 deletions administrator/components/com_contact/models/contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,46 +214,18 @@ protected function getListQuery()

if ($assoc)
{
$query->select('COUNT(' . $db->quoteName('asso2.id') . ') > 1 as ' . $db->quoteName('association'))
->join(
'LEFT',
$db->quoteName('#__associations', 'asso') . ' ON ' . $db->quoteName('asso.id') . ' = ' . $db->quoteName('a.id')
. ' AND ' . $db->quoteName('asso.context') . ' = ' . $db->quote('com_contact.item')
)
->join(
'LEFT',
$db->quoteName('#__associations', 'asso2') . ' ON ' . $db->quoteName('asso2.key') . ' = ' . $db->quoteName('asso.key')
)
->group(
$db->quoteName(
array(
'a.id',
'a.name',
'a.alias',
'a.checked_out',
'a.checked_out_time',
'a.catid',
'a.user_id',
'a.published',
'a.access',
'a.created',
'a.created_by',
'a.ordering',
'a.featured',
'a.language',
'a.publish_up',
'a.publish_down',
'ul.name' ,
'ul.email',
'l.title' ,
'l.image' ,
'uc.name' ,
'ag.title' ,
'c.title',
'c.level'
)
$subQuery = $db->getQuery(true)
->select('COUNT(' . $db->quoteName('asso1.id') . ') > 1')
->from($db->quoteName('#__associations', 'asso1'))
->join('INNER', $db->quoteName('#__associations', 'asso2') . ' ON ' . $db->quoteName('asso1.key') . ' = ' . $db->quoteName('asso2.key'))
->where(
array(
$db->quoteName('asso1.id') . ' = ' . $db->quoteName('a.id'),
$db->quoteName('asso1.context') . ' = ' . $db->quote('com_contact.item'),
)
);

$query->select('(' . $subQuery . ') AS ' . $db->quoteName('association'));
}

// Filter by access level.
Expand Down
19 changes: 12 additions & 7 deletions administrator/components/com_content/models/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,8 @@ protected function getListQuery()
->join('LEFT', '#__users AS ua ON ua.id = a.created_by');

// Join on voting table
$assogroup = 'a.id, l.title, l.image, uc.name, ag.title, c.title, ua.name, c.created_user_id, c.level, parent.id';

if (JPluginHelper::isEnabled('content', 'vote'))
{
$assogroup .= ', v.rating_sum, v.rating_count';
$query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count')
->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
Expand All @@ -232,10 +229,18 @@ protected function getListQuery()
// Join over the associations.
if (JLanguageAssociations::isEnabled())
{
$query->select('CASE WHEN COUNT(asso2.id)>1 THEN 1 ELSE 0 END as association')
->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_content.item'))
->join('LEFT', '#__associations AS asso2 ON ' . $db->quoteName('asso2.key') . ' = ' . $db->quoteName('asso.key'))
->group($assogroup);
$subQuery = $db->getQuery(true)
->select('COUNT(' . $db->quoteName('asso1.id') . ') > 1')
->from($db->quoteName('#__associations', 'asso1'))
->join('INNER', $db->quoteName('#__associations', 'asso2') . ' ON ' . $db->quoteName('asso1.key') . ' = ' . $db->quoteName('asso2.key'))
->where(
array(
$db->quoteName('asso1.id') . ' = ' . $db->quoteName('a.id'),
$db->quoteName('asso1.context') . ' = ' . $db->quote('com_content.item'),
)
);

$query->select('(' . $subQuery . ') AS ' . $db->quoteName('association'));
}

// Filter by access level.
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_fields/helpers/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public static function getFields($context, $item = null, $prepareValue = false,
}

self::$fieldsCache->setState('filter.context', $context);
self::$fieldsCache->setState('filter.assigned_cat_ids', array());

/*
* If item has assigned_cat_ids parameter display only fields which
Expand Down
16 changes: 12 additions & 4 deletions administrator/components/com_menus/models/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,18 @@ protected function getListQuery()

if ($assoc)
{
$query->select('COUNT(asso2.id)>1 as association')
->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_menus.item'))
->join('LEFT', '#__associations AS asso2 ON asso2.key = asso.key')
->group('a.id, e.enabled, l.title, l.image, u.name, c.element, ag.title, e.name, mt.id, mt.title, l.sef');
$subQuery = $db->getQuery(true)
->select('COUNT(' . $db->quoteName('asso1.id') . ') > 1')
->from($db->quoteName('#__associations', 'asso1'))
->join('INNER', $db->quoteName('#__associations', 'asso2') . ' ON ' . $db->quoteName('asso1.key') . ' = ' . $db->quoteName('asso2.key'))
->where(
array(
$db->quoteName('asso1.id') . ' = ' . $db->quoteName('a.id'),
$db->quoteName('asso1.context') . ' = ' . $db->quote('com_menus.item'),
)
);

$query->select('(' . $subQuery . ') AS ' . $db->quoteName('association'));
}

// Join over the extensions
Expand Down
16 changes: 12 additions & 4 deletions administrator/components/com_newsfeeds/models/newsfeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,18 @@ protected function getListQuery()

if ($assoc)
{
$query->select('COUNT(asso2.id)>1 AS association')
->join('LEFT', $db->quoteName('#__associations', 'asso') . ' ON asso.id = a.id AND asso.context = ' . $db->quote('com_newsfeeds.item'))
->join('LEFT', $db->quoteName('#__associations', 'asso2') . ' ON asso2.key = asso.key')
->group('a.id, l.title, l.image, uc.name, ag.title, c.title');
$subQuery = $db->getQuery(true)
->select('COUNT(' . $db->quoteName('asso1.id') . ') > 1')
->from($db->quoteName('#__associations', 'asso1'))
->join('INNER', $db->quoteName('#__associations', 'asso2') . ' ON ' . $db->quoteName('asso1.key') . ' = ' . $db->quoteName('asso2.key'))
->where(
array(
$db->quoteName('asso1.id') . ' = ' . $db->quoteName('a.id'),
$db->quoteName('asso1.context') . ' = ' . $db->quote('com_newsfeeds.item'),
)
);

$query->select('(' . $subQuery . ') AS ' . $db->quoteName('association'));
}

// Filter by access level.
Expand Down
3 changes: 2 additions & 1 deletion plugins/editors/tinymce/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ public function onDisplay(
'templates' => $templates,
'image_advtab' => (bool) $levelParams->get('image_advtab', false),
'external_plugins' => empty($externalPlugins) ? null : $externalPlugins,

'contextmenu' => (bool) $levelParams->get('contextmenu', true) ? null : false,
'elementpath' => (bool) $levelParams->get('element_path', true),
)
);

Expand Down

0 comments on commit c594a37

Please sign in to comment.