Skip to content

Commit

Permalink
revert unwanted side-effect
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Nov 1, 2017
1 parent e4598a2 commit c92190a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions administrator/components/com_plugins/models/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,15 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
$folder = $this->getState('item.folder');
$element = $this->getState('item.element');
$lang = JFactory::getLanguage();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());

// Load the core and/or local language sys file(s) for the ordering field.
$db = $this->getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('element'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('extension_id') . ' = ' . $data->extension_id)
->where($db->quoteName('access') . ' IN (' . $groups . ')');
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
->where($db->quoteName('folder') . ' = ' . $db->quote($folder));

$db->setQuery($query);
$elements = $db->loadColumn();

Expand All @@ -259,7 +258,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
|| $lang->load('plg_' . $folder . '_' . $elementa . '.sys', JPATH_PLUGINS . '/' . $folder . '/' . $elementa, null, false, true);
}

if (empty($folder) || empty($element) || empty($elements))
if (empty($folder) || empty($element))
{
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php?option=com_plugins&view=plugins', false));
Expand Down

0 comments on commit c92190a

Please sign in to comment.