New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL error related to GROUP BY #19
Comments
mmmm not sure what the issue is here; PRs would be welcome! |
Having same issue locally. Disabling strict mode on MySQL got rid of the error but not always possible on shared hosting environments. |
Having issue as well. Haven't had time to dig into the Craft CMS changelog, but Similar broke right after upgrading to the latest. Was working just before upgrading to the latest. I can post more details if needed, but a bit busy at the moment. |
Figured out how to work around my problem. Was getting... And had this code...
Removing the section parameter from limitCriteria got rid of the error. I can make this work for my needs. I'm realizing now that this wasn't actually the same error that was reported here. Sorry if I bloated the comments unnecessarily. :/ |
@robmcfadden No worries! I actually have a very similar setup in the template so tried also removing the section parameter but it had no affect, I still got the error. @khalwat It's a bit over my head to be honest, is there anything that needs flagging up with the Craft dev team on this? |
Same issue with me. |
Happy to have a PR to fix the issue! |
Just a quick update to say this remains an issue in Interestingly on MySQL 5.6.47 my code is also broken unless I remove the |
I just ran into this as well after updating from Craft 3.3 to Craft 3.4. I'd PR if my brain was bigger but it's a pea. Happening locally with MySQL v5.7.22.
|
I'm getting the same error as @robmcfadden and removing the section parameter fixed it for me as well. |
I've been unusually busy lately, and this doesn't look like a simple problem to solve. Would love it if anyone from the community is able to help out to diagnose and fix this. |
Had the same error and changing the section parameter from |
Sill having this issue on Similar v1.0.6 but it looks like in the changelog it was fixed? MySQL v5.7.22, Craft 3.4.20. I'd be down this being a paid plugin fer sure! 👍 |
Still accepting PRs! @brianlarson have you tried what @klick mentioned above? |
I did but unfortunately it didn't werk in my case! |
A combination of running the good ol’ try {
Craft::$app
->getDb()
->createCommand('SET SESSION sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";')
->execute();
} catch (Exception $exception) {
// do nothing
} There might be an official Craft way of doing this since |
I'm going to see about devoting some time to fixing this up in the near term |
This should be fixed in the dev-develop branch You can try it now by setting your semver in your "nystudio107/craft-similar": "dev-develop as 1.1.0”, Then do a Let me know how you go... |
@khalwat Really appreciate you taking a look at this. I can confirm that the update corrected the issue on my end. |
Thanks, will let a few others hopefully verify before releasing... anyone able to test on Postgres? |
Hello,
I'm getting the following SQL error
The stack trace seems to indicate it's originating from line
103
in theSimilar.php
service which is$results = $query->all();
. I suspect it's something in the setup of that $query but couldn't see anywhere that GROUP By was being used.In case it helps the full query that's been compiled is
which is being built from this twig code
Craft v3.4.8
Similar v1.0.6
MySQL 5.7.26
PHP 7.2.20
The text was updated successfully, but these errors were encountered: