Page 1 of 1

Weird css error

Posted: Tue Jun 21, 2016 5:45 pm
by nervino
Hello, I have uploaded a cmsms' 2.1.4 site from development environment to production server and I got this error in Design Manager => Stylesheets tab:

Code: Select all

SELECT SQL_CALC_FOUND_ROWS DISTINCT S.id FROM cms_layout_stylesheets S ORDER BY S.name ASC LIMIT 0, 100 -- Expression #1 of ORDER BY clause is not in SELECT list, references column 'mydb.S.name' which is not in SELECT list; this is incompatible with DISTINCT
The frontend works fine except for css.

- Server: ubuntu 16.04 (both development and production).
- I have exported/imported the db with phpmyadmin tool.
- I tried to install in two different ubuntu 16.04 servers with the same result.
- In dev it works great, of course...

Any ideas..?

Thanks

Re: Weird css error

Posted: Tue Jun 21, 2016 6:00 pm
by calguy1000
So you have two Ubuntu 16.04 servers... and in one environment it works.. and in another you get the error.

This tells me that there is a difference in Mysql versions and/or configurations.

A little bit of googling brings me to this link: https://dev.mysql.com/doc/refman/5.7/en ... dling.html

which states:
MySQL 5.7.5 and up implements detection of functional dependence. If the ONLY_FULL_GROUP_BY SQL mode is enabled (which it is by default), MySQL rejects queries for which the select list, HAVING condition, or ORDER BY list refer to nonaggregated columns that are neither named in the GROUP BY clause nor are functionally dependent on them. (Before 5.7.5, MySQL does not detect functional dependency and ONLY_FULL_GROUP_BY is not enabled by default. For a description of pre-5.7.5 behavior, see the MySQL 5.6 Reference Manual.)
So it looks like the problem was solved in your development server and you need to also solve it in your production server.

At this time I would suggest solving it at the server level as there may be other problems with this new mysqli default setting in other places.

Re: Weird css error

Posted: Wed Jun 22, 2016 6:33 pm
by nervino
I think you are right, as usual.
Thank you for the hint!

(I discovered that the production server isn't an ubuntu 16.04 - as I took for granted - but a 14.04.4 version with upgraded versions of PHP and MySQL.
The ubuntu 16.04 that I had installed in vmware has not the ONLY_FULL_GROUP_BY sql mode enabled, hence I think that it is shipped with ONLY_FULL_GROUP_BY disabled by default, cause I didn't disabled it).