It looks like you're new here. If you want to get involved, click one of these buttons!
Some Fuel sites I have migrated to a new server, and on at least 2 occasions (so far) the Blog module has hit errors regarding MySQL 1055 error (where MySQL is v5.7.23).
In the Blog users and posts models' common queries, there is only 1 column in the GROUP BY, but this is denied by the MySQL settings.
I fixed the errors using:
posts model _common_query()
$this->db->group_by([$this->_tables['blog_posts'].'.id', $this->_tables['blog_users'].'.display_name' ]);
and in users model _common_query():
$this->db->group_by([$this->_tables['fuel_users'].'.id', $this->_tables['blog_users'].'.id']);
Comments
Can you run $this->debug_query() after it executes the query to output the raw SQL statement?
Actually... that won't work if it's erring before that.
It looks like it has something to do with the MySQL setting of "STRICT_TRANS_TABLES" (new one for me). I've pushed that fix to the blog module.
I was getting this specifically:
Error Code: 1055. Expression #26 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'display_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
The expression number varied in each model instance .
It was new to me too - a new Cpanel / MySQL configuration default!?
I came across the same error (MySQL 5.7)
with this query:
Which originated from this piece of code in my Authors_model (copied from blog module I believe)
The solution, and this StackOverflow answer helped me to understand the problem, was adding
temp.posts_count
to the group by clauseI'll send a pull request on github.
There was a fix for that posted in August I believe:
https://github.com/daylightstudio/FUEL-CMS-Blog-Module/commit/d4d0e673285939321694a8e29bcd55253b913411
yes, but I got this error:
and adding
, temp.posts_count
solved it. And the error message is pointing out that "nonaggregated column 'temp.posts_count'" is the issue. I only had this problem on the live server where MySQL was configured more strict. Maybe it helps if someone else is coming across this.Cheers.