24hoursmedia-craftcms / views-work

Craft CMS views plugin
Other
1 stars 2 forks source link

Fix queries without quotations #82

Closed ccchapman closed 1 year ago

ccchapman commented 2 years ago

Summary

This fixes exceptions thrown when the DBMS is PostgreSQL.

Test me. With these changes, I can verify the primary plugin features are working as expected. I have not performed extensive testing or deep exploration of the plugin code.

A redacted exception example:

SQLSTATE[42703]: Undefined column: 7 ERROR:  column elements_sites.elementid does not exist
LINE 10: LEFT JOIN "viewswork_viewrecording" "___vr" ON elements_site...
                                                        ^
HINT:  Perhaps you meant to reference the column "elements_sites.elementId".

Reference

Yii DAO will automatically convert such constructs into the corresponding quoted column or table names using the DBMS specific syntax.

Quoting Table and Column Names

24hoursmedia-craftcms commented 1 year ago

Thank you, I will release this in 2.0.3.0 I was not able to test in depth on postgres, but it appears to work on mysql correctly.