Closed jkudish closed 10 months ago
Hi @jkudish, and thank you so much for looking into this and submitting a PR! I'll check it over locally, but I wanted to ask if you would be willing to also submit the issue and PR over in the BerlinDB repository? Berlin is the package/library we are using to manage our custom database tables, and based on what you're saying, it looks like this is a fix that should be applied in there.
Apologies for the delay. I've moved this over to https://github.com/berlindb/core/pull/164 as suggested
This PR attempts to fix the issue described in #9699
Use the received table name & table alias arguments in the
get_sql
function to set those as properties on the Date class. Note thatget_sql
already gets called with those params as per the line below. However theget_sql
function oddly wasn't defining those arguments in its definition.https://github.com/awesomemotive/easy-digital-downloads/blob/715373d18971c8b12e949bb3fd5d6c40aac6c234/includes/database/engine/class-query.php#L1363
Then, when building the SQL query, use the alias or name (only if available) to prepend to the column name in the query. This prevents ambiguity issues when performing the SQL query
This prevents and fixes the issue described in https://github.com/awesomemotive/easy-digital-downloads/issues/9699
I am open to receiving feedback on the solution proposed and working on an updated solution.
Thanks!