?
avatar helvecio
helvecio
19 May 2017

Steps to reproduce the issue

  1. Create different users (at least three)
  2. Create a category
  3. Create one article in the category created in step 2 and assign each one to a different author
  4. Create a menu item: Articles > Category List
  5. Choose the category created in step 2
  6. In the Lista Layouts parameters, go to Article Order and choose either Author Alphabetical or Author Reverse Alphabetical
  7. Click on the link to see the category listed by Authors Alphabetical (Reverse or not)
  8. Click on an article title

Expected result

See the article as expected

Actual result

A The requested page can't be found page.
The page header states Error: 1054 Unknown column 'u.name' in 'order clause'

System information (as much as possible)

PHP Built On: Darwin MacBook-Pro-de-Helvecio.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Database Version: 5.6.35
Database Collation: utf8_general_ci
Database Connection Collation: utf8mb4_general_ci
PHP Version: 7.0.15
Web Server: Apache/2.2.31 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.0.15 mod_ssl/2.2.31 OpenSSL/1.0.2j DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.24.0
WebServer to PHP Interface:apache2handler
Joomla! Version: Joomla! 3.7.1 Stable [ Amani ] 17-May-2017 14:00 GMT
Joomla! Platform Version: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar helvecio helvecio - open - 19 May 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 May 2017
avatar brianteeman
brianteeman - comment - 19 May 2017

I can confirm this

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 May 2017
Status New Confirmed
avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Jun 2017

this one is interresting.
this is clearly a bug that exists ... for ages, it seems.

The problem here is page navitation plugin is making a db query asking to order by u.name when there is no u.name column in the query.
See here https://github.com/joomla/joomla-cms/blob/staging/plugins/content/pagenavigation/pagenavigation.php#L106

I guess u. should be the users table and name the field but that query does not join the users table so it will always give a sql error.

Example:

SELECT a.id, a.title, a.catid, a.language,
CASE WHEN CHAR_LENGTH(a.alias) != 0 THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug,
CASE WHEN CHAR_LENGTH(cc.alias) != 0 THEN CONCAT_WS(':', cc.id, cc.alias) ELSE cc.id END as catslug
FROM #__content AS a
LEFT JOIN #__categories AS cc ON cc.id = a.catid
WHERE a.catid = 9
AND a.state = 1
AND (a.state = 1 OR a.state = -1)
AND (publish_up = '0000-00-00 00:00:00' OR publish_up <= '2017-06-06 19:11:04')
AND (publish_down = '0000-00-00 00:00:00' OR publish_down >= '2017-06-06 19:11:04')
AND a.language in ('en-GB','*')
ORDER BY a.created_by_alias, u.name <-- HERE
avatar alikon
alikon - comment - 7 Jun 2017

same thinking...
please test #16556

avatar brianteeman
brianteeman - comment - 7 Jun 2017

Closed as we have a PR

avatar brianteeman brianteeman - change - 7 Jun 2017
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2017-06-07 08:32:00
Closed_By brianteeman
avatar brianteeman brianteeman - close - 7 Jun 2017

Add a Comment

Login with GitHub to post a comment