##WHERE## Is Disappearing Randomly After Kentico Update from 8.2->12

kentico guy asked on February 21, 2022 19:16

I'm having a really strange issue happen where my ##WHERE## clause is being removed randomly along with the WHERE in the SQL query itself. This started happening after I upgraded from K8.2 to K12 Portal Engine. Also, sometimes if I run from my computer in localhost it doesn't do this, but if I push into Azure for a release build it will start happening.

Has anyone ever seen Kentico just remove the WHERE ##WHERE## from SQL queries in the query repeater? I'm using the out of box query repeater with no modifications.

Why would kentico decide to just remove the WHERE ##WHERE## ??? There are no other exceptions upstream from this. I'm only getting one exception which is because the WHERE clause is being completely stripped out by kentico.

Correct Answer

kentico guy answered on February 24, 2022 21:08

I fixed this issue by merging the CMSApp_AppCode project into CMSApp then deleting CMSApp_AppCode after upgrading to Kentico 10. I had to redo a lot of work but it fixed this issue. Must have been some type of assembly or type conflict causing the issue, even though there were no errors in the app or logs.

https://devnet.kentico.com/questions/kentico-upgrade-tool-didn-t-merge-cmsapp_appcode-and-cmsapp-projects;-when-is-this-supposed-to-happ

0 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on February 22, 2022 09:55

What are the steps? Do you have any examples of the query from which the macro is removed? There were made some improvements and security adjustments and the ##WHERE## macro can be placed only in the WHERE part of the SQL query - it was often misused in other parts of the query which could lead to security issues.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.