-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Craft 5 upgrade – Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 16 #52
Comments
Can you include the complete error as text (rather than a screenshot) so I can search through it? |
Hi Andrew. I should have done that but I have since made a new clean install. I had some other errors here too like not being able to change currency on my craft commerce store and so on so I decided to quickly start over. I am in the middle of re-creating the data in Craft and also the front end with my old templates so if that error pops up again I will update this issue. Until that we can treat this as resolved. Best |
So, same error as above on a fresh install. Tags or no tags attached makes no difference. Full error text: Database Exception – yii\db\Exception
{% block content %}
13. in /var/www/html/vendor/twig/twig/src/Template.php at line 394– [__TwigTemplate_136af783244a05f4de8513bdb7249cb5::doDisplay](http://twig.sensiolabs.org/api/2.x/Twig/Template.html#method_doDisplay)(['product' => craft\commerce\elements\Product, 'variables' => ['product' => craft\commerce\elements\Product], 'craft' => craft\web\twig\variables\CraftVariable, 'currentSite' => craft\models\Site, ...], ['content' => [__TwigTemplate_136af783244a05f4de8513bdb7249cb5, 'block_content']])
14. in /var/www/html/vendor/twig/twig/src/Template.php at line 367– [Twig\Template::displayWithErrorHandling](http://twig.sensiolabs.org/api/2.x/Twig/Template.html#method_displayWithErrorHandling)(['product' => craft\commerce\elements\Product, 'variables' => ['product' => craft\commerce\elements\Product], 'craft' => craft\web\twig\variables\CraftVariable, 'currentSite' => craft\models\Site, ...], ['content' => [__TwigTemplate_136af783244a05f4de8513bdb7249cb5, 'block_content']])
15. in /var/www/html/vendor/twig/twig/src/Template.php at line 379– [Twig\Template::display](http://twig.sensiolabs.org/api/2.x/Twig/Template.html#method_display)(['product' => craft\commerce\elements\Product, 'variables' => ['product' => craft\commerce\elements\Product]])
16. in /var/www/html/vendor/twig/twig/src/TemplateWrapper.php at line 38– [Twig\Template::render](http://twig.sensiolabs.org/api/2.x/Twig/Template.html#method_render)(['product' => craft\commerce\elements\Product, 'variables' => ['product' => craft\commerce\elements\Product]])
17. in /var/www/html/vendor/twig/twig/src/Environment.php at line 280– [Twig\TemplateWrapper::render](http://twig.sensiolabs.org/api/2.x/Twig/TemplateWrapper.html#method_render)(['product' => craft\commerce\elements\Product, 'variables' => ['product' => craft\commerce\elements\Product]])
18. in /var/www/html/vendor/craftcms/cms/src/web/View.php at line 488– [Twig\Environment::render](http://twig.sensiolabs.org/api/2.x/Twig/Environment.html#method_render)('artikel.twig', ['product' => craft\commerce\elements\Product, 'variables' => ['product' => craft\commerce\elements\Product]])
482483484485486487488489490491492493494
// Render and return
$renderingTemplate = $this->_renderingTemplate;
$this->_renderingTemplate = $template;
|
So I think this is the same as: #51 Can you try this update to see how it works for you? You can try it now by setting your semver in your "nystudio107/craft-similar": "dev-develop-v5 as 5.0.1”, Then do a Let me know how it works out for you! |
Different error now after changing db collation to
After updating similar to
as per your suggestion, the above error remained the same. |
Alright, I think I've got it. Addressed in the above commit. Do this again and it should update with the latest changes from the You can try it now by setting your semver in your "nystudio107/craft-similar": "dev-develop-v5 as 5.0.1”, Then do a Let me know how it works out for you! |
Did that but I get the same error as before:
|
@klick you'll need to give me more context on that error, but it's very possible that this isn't actually an issue with the Similar plugin. I just can't tell without seeing the full stack trace from the error... and the stack trace you posted earlier seems like it is different from this one? (nowhere in the stack trace you posted does it show |
I've released version Which fixes two verified, legit bugs. If there are more issues you find after updating to that version, I can continue to work with you on them. |
Hi Andrew. I have upgraded to 5.0.1 and it still gives me the above error. It’s entirely possible that similar might not be the problem though this happens on a fresh install in a new ddev container. So that makes it hard to identify legacy issues. Full Error code:
|
Fixed in the following releases: Craft 3: https://github.com/nystudio107/craft-similar/releases/tag/1.1.7 Craft 4: https://github.com/nystudio107/craft-similar/releases/tag/4.0.2 Craft 5: https://github.com/nystudio107/craft-similar/releases/tag/5.0.2 |
Thanks Andrew. Did the upgrade to 5.0.2 and also the Craft and ddev update which all referenced db issues but still get the same error:
Maybe my installation is cursed? ;) Full error message:
|
So I have just changed my criteria from
to
which obviously was wrong. Now works as expected. |
Describe the bug
After upgrading to Craft 5 I get the following error:
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 16
when calling
{% set similarProductsByTags = craft.similar.find({ element: product, context: product.schlagwoerter }) %}
in my product detail view template.
Versions
Similar: dev-develop-v5
Craft: Craft Pro 5.2.0
Commerce: Pro 5.0.10.1
Database: type: mariadb, version: "10.4"
PHP: 8.2
Screenshots
The text was updated successfully, but these errors were encountered: