I have encountered the strangest things with collections and addFieldToFilter() function.
The given example is not always the case and sometimes the code had been working for months.
I execute the following code:
This translates to the following faulty query:
WHERE ```main_table```.```type_id``` = '5'
Which gives an unknown column exception from MySQL.
Changing the code to:
Fixes the issue. The strange thing is that the first code worked for months and maybe years and now out of blue gives an MySQL exception. Besides in other places in the code it still works (using curly quotes in addFieldToFilter() function).
Anyone got a clue?
Solved! Go to Solution.
I think you have applied the latest patch.