Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Rename 'associations' table to 'languages_associations' #218

Merged
merged 1 commit into from
Jul 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/administrator/components/com_menus/helpers/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ static public function getAssociations($pk)
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->from('#__menu as m')
->join('INNER', '#__associations as a ON a.id=m.id AND a.context=' . $db->quote('com_menus.item'))
->join('INNER', '#__associations as a2 ON a.key=a2.key')
->join('INNER', '#__languages_associations as a ON a.id=m.id AND a.context=' . $db->quote('com_menus.item'))
->join('INNER', '#__languages_associations as a2 ON a.key=a2.key')
->join('INNER', '#__menu as m2 ON a2.id=m2.id')
->where('m.id=' . (int) $pk)
->select('m2.language, m2.id');
Expand Down
4 changes: 2 additions & 2 deletions app/administrator/components/com_menus/models/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ public function save($data)
// Deleting old association for these items
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->delete('#__associations')
->delete('#__languages_associations')
->where('context=' . $db->quote('com_menus.item'))
->where('id IN (' . implode(',', $associations) . ')');
$db->setQuery($query);
Expand All @@ -1277,7 +1277,7 @@ public function save($data)
// Adding new association for these items
$key = md5(json_encode($associations));
$query->clear()
->insert('#__associations');
->insert('#__languages_associations');
foreach ($associations as $id)
{
$query->values($id . ',' . $db->quote('com_menus.item') . ',' . $db->quote($key));
Expand Down
4 changes: 2 additions & 2 deletions app/administrator/components/com_menus/models/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ 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')
->join('LEFT', '#__languages_associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_menus.item'))
->join('LEFT', '#__languages_associations AS asso2 ON asso2.key = asso.key')
->group('a.id');
}

Expand Down
4 changes: 2 additions & 2 deletions lib/libraries/cms/language/associations.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public static function getAssociations($extension, $tablename, $context, $id, $p
$query = $db->getQuery(true)
->select($db->quoteName('c2.language'))
->from($db->quoteName($tablename, 'c'))
->join('INNER', $db->quoteName('#__associations', 'a') . ' ON a.id = c.id AND a.context=' . $db->quote($context))
->join('INNER', $db->quoteName('#__associations', 'a2') . ' ON a.key = a2.key')
->join('INNER', $db->quoteName('#__languages_associations', 'a') . ' ON a.id = c.id AND a.context=' . $db->quote($context))
->join('INNER', $db->quoteName('#__languages_associations', 'a2') . ' ON a.key = a2.key')
->join('INNER', $db->quoteName($tablename, 'c2') . ' ON a2.id = c2.' . $db->quoteName($pk));

// Use alias field ?
Expand Down