SQL error in filters since upgrading to V12

I am getting errors in my custom filters after upgrading to V12. Examining the logs I found out some strings are quoted with 2 single quotes like this where type = ''Branch''
Any hint?