Skip to content

Commit

Permalink
Merge branch '4.0-dev' into switcher-label
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Dec 6, 2019
2 parents 7af9434 + f794274 commit 79e195c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ public function save($key = null, $urlVar = null)
}

$data['link'] = 'index.php?' . urldecode(http_build_query($args, '', '&'));
unset($data['request']);
}

// Check for validation errors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ public function resync()
return;
}

// Declare variables before binding.
$componentId = 0;
$itemId = 0;

$query = $db->getQuery(true)
->update($db->quoteName('#__menu'))
->set($db->quoteName('component_id') . ' = :componentId')
Expand Down
4 changes: 0 additions & 4 deletions administrator/components/com_menus/Model/ItemModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1381,10 +1381,6 @@ public function rebuild()
return false;
}

// Declare paramaters before binding.
$id = 0;
$params = '';

$query = $db->getQuery(true)
->update($db->quoteName('#__menu'))
->set($db->quoteName('params') . ' = :params')
Expand Down
22 changes: 7 additions & 15 deletions administrator/components/com_menus/Model/MenusModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function getItems()
$db = $this->getDbo();
$menuTypes = array_column((array) $items, 'menutype');

// Get the published menu counts.
$query = $db->getQuery(true)
->select(
[
Expand All @@ -89,14 +88,17 @@ public function getItems()
]
)
->from($db->quoteName('#__menu', 'm'))
->where($db->quoteName('m.published') . ' = 1')
->where($db->quoteName('m.published') . ' = :published')
->whereIn($db->quoteName('m.menutype'), $menuTypes, ParameterType::STRING)
->group($db->quoteName('m.menutype'));
->group($db->quoteName('m.menutype'))
->bind(':published', $published, ParameterType::INTEGER);

$db->setQuery($query);

// Get the published menu counts.
try
{
$published = 1;
$countPublished = $db->loadAssocList('menutype', 'count_published');
}
catch (\RuntimeException $e)
Expand All @@ -107,14 +109,9 @@ public function getItems()
}

// Get the unpublished menu counts.
$query->clear('where')
->bind()
->where($db->quoteName('m.published') . ' = 0')
->whereIn($db->quoteName('m.menutype'), $menuTypes, ParameterType::STRING);
$db->setQuery($query);

try
{
$published = 0;
$countUnpublished = $db->loadAssocList('menutype', 'count_published');
}
catch (\RuntimeException $e)
Expand All @@ -125,14 +122,9 @@ public function getItems()
}

// Get the trashed menu counts.
$query->clear('where')
->bind()
->where($db->quoteName('m.published') . ' = -2')
->whereIn($db->quoteName('m.menutype'), $menuTypes, ParameterType::STRING);
$db->setQuery($query);

try
{
$published = -2;
$countTrashed = $db->loadAssocList('menutype', 'count_published');
}
catch (\RuntimeException $e)
Expand Down
61 changes: 31 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions libraries/src/Installer/Adapter/LanguageAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ protected function finaliseUninstall(): bool

$count = 0;

// Declare parameters before binding.
$userId = 0;
$registry = '';

// Prepare the query.
$query = $db->getQuery(true)
->update($db->quoteName('#__users'))
Expand Down

0 comments on commit 79e195c

Please sign in to comment.