internetztube / craft-element-relations

Shows all relations of an element.
https://plugins.craftcms.com/element-relations
Other
2 stars 6 forks source link

Fix issue 1 #2

Closed gbowne-quickbase closed 2 years ago

gbowne-quickbase commented 2 years ago

These format changes to reference the tables with the {{%tablename}} format fixed the error for me. Should fix #1

internetztube commented 2 years ago

Thank you very much for the PR. Interesting that this resolves your issue. Will merge it later today.

gbowne-quickbase commented 2 years ago

Thank you very much for the PR. Interesting that this resolves your issue. Will merge it later today.

Essentially the error was that the tables couldn't be found. We have a table prefix on our tables, so the {{%tablename}} looks up the full table name. You've got a few places where you use a different method, like below, but I think this query needs this fix

->from(['relations' => Table::RELATIONS])
internetztube commented 2 years ago

Thanks, @gbowne-quickbase for the pull request, helped a lot. I used the solution you gave in your last comment.