Publisher does not support the Fluid field type. Please do not contact asking when support will be available.
If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.
Ticket: SQL Error with Relationship Fields in Bloqs
Status | Resolved |
Add-on / Version | Bloqs 4.0.13 |
Severity | |
EE Version | 5.0.1 |
Jarod Clark
Nov 26, 2018Hello,
Just updated to Bloqs 4.0.13 to see if some other bugs I was seeing with Bloqs with relationship fields was fixed, and now I’m getting SQL errors on any pages with relationships. Removing the bloq fixes the page, and re-creating it brings the error back.
BoldMinded (Brian)
Are you using Publisher? Is this error happening on the front-end or when doing a Live Preview in the CP?
Jarod Clark
No, not using Publisher. This is happening on the frontend. Interestingly enough, it works fine in the Live Preview. Just tested that.
BoldMinded (Brian)
The ext.bloqs.php file has the following method at line 127:
Change the beginning of it to this instead and see if that fixes it (you’re adding the str_replace part)
Jarod Clark
Just added that, no change.
Would you like me to give you access to this site for direct debugging? (There’s some other issues I’m running into that I’ll make tickets for as needed once this is resolved).
BoldMinded (Brian)
Sure, edit the ticket and provide FTP info to a dev site, and make sure that the publisher files are writable. Provide entry_id of an entry that I can use to replicate the issue, and the URL to where I can see it on the front-end.
Jarod Clark
FYI, I’m unable to edit the ticket.
Throw’s this error:
BoldMinded (Brian)
Try now… I really need to fix that bug on my own site :/
Jarod Clark
Still the same error.
Want me to just email info?
BoldMinded (Brian)
No, just add it as a private comment. I’d rather not have people’s FTP info in my inbox 😊
Jarod Clark
Comment has been marked private.
BoldMinded (Brian)
Does the repeated block issue sound like this? https://boldminded.com/support/ticket/1877
Jarod Clark
Hrm, similar but not quite the same.
In my case, I have two different bloqs (“leadership” and “team”). They each have essentially the same fields (atoms): a text input called “heading” and a relationship field called “team_members”.
These are being used for outputting the content in two very different ways, hence the different bloq types.
On that about us page I linked you above, I have a “leadership” bloq (with 2 entries selected) followed by a “team” bloq (also with 2 entries selected). Both are actually under their own parent bloqs, so they’re not even direct siblings. Leadership is displayed once, Team is displayed 3 times.
BoldMinded (Brian)
Create a new ticket for that issue, include as much information as possible, and break it down into a repeatable case in a template with nothing else in it, no snippets, embeds, etc, only the code necessary to replicate the issue. Same as before, provide the entry_id and the URL in which I can see the error happen on the front end.
Jarod Clark
Yep will do once we have this current issue addressed.
Thanks!
BoldMinded (Brian)
It’s doubling part of the query string for some reason prior to it being executed.
This one works fine…
This is the one failing…
BoldMinded (Brian)
Ok, I can’t figure it out, and I can’t replicate the issue in my local environment. At this point I’d like you to create a brand new EE install with only Bloqs installed, a single entry with a Bloqs field, 1 block, and a couple of entries for the relationship, and 1 template file to re-create the issue. We need to be sure another add-on isn’t intruding on the query somehow (yes, I’ve seen this happen before). I made a test template in your current install that you can use: admin.php?/cp/design/template/edit/9
Jarod Clark
Comment has been marked private.
BoldMinded (Brian)
Ok, I was able to replicate this locally by disabling Publisher. Somehow when Publisher is installed, it works fine, when it’s not installed, the query breaks. ¯_(ツ)_/¯
BoldMinded (Brian)
So, at its core, this is an EE issue. I submitted a PR that fixes it… you can make the code change in EE directly since it’s a very simple fix.
https://github.com/ExpressionEngine/ExpressionEngine/pull/24
BoldMinded (Brian)
Looks like Kevin merged that into EE core for the next release, so if you make that change manually to your local install it should resolve the issue.
Jarod Clark
Just a heads up that the pull request you did fixed this issue.
Also, looking at the other ticket you linked, it turns out it was the same issue, just at the atom level instead of the bloq level. Both leadership and team bloqs had an atom called “team_members”. I renamed one of them and it’s all working properly now.
BoldMinded (Brian)
Cool! I’ll close this out then.