?
avatar freegink
freegink
5 Nov 2016

Steps to reproduce the issue

  1. Go to "Menu->Manage"
  2. Select a menu
  3. Click "Edit"

Expected result

Editing menu interface should appear.

Actual result

An SQL exception happens:
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]No column name was specified for column 1 of 'A'. SQL=SELECT * FROM ( SELECT count(id) , ROW_NUMBER() OVER (ORDER BY (select 0)) AS RowNumber FROM #__usergroups) A WHERE A.RowNumber BETWEEN 1 AND 1

System information (as much as possible)

Joomla 3.6.4
Windows Server 2008 R2
IIS 7
SQL Server 2008 R2

Additional comments

This exception is caused by below code in "/libraries/cms/helper/usergroups.php". setQuery shouldn't pass "limit" and "offset" parameters because an alias is required for aggregation "count(id)" in subquery.

        public function total()
    {
        if (null === $this->total)
        {
            $db = JFactory::getDbo();
            $query = $db->getQuery(true)
                ->select('count(id)')
                ->from('#__usergroups');
            $db->setQuery($query, 0, 1);
            $this->total = (int) $db->loadResult();
        }
        return $this->total;
    }
avatar freegink freegink - open - 5 Nov 2016
avatar joomla-cms-bot joomla-cms-bot - change - 5 Nov 2016
Labels Added: ?
avatar zero-24
zero-24 - comment - 5 Nov 2016

Closing as there is a PR at #12762

avatar zero-24 zero-24 - change - 5 Nov 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-11-05 04:47:26
Closed_By zero-24
avatar zero-24 zero-24 - close - 5 Nov 2016

Add a Comment

Login with GitHub to post a comment