I wonder if anyone can help. I have a content type (FAQ) that I deploy in several different webs. I then use a CQWP to display all the FAQs used (aggregating them from different subwebs).
This was working fine, then it stopped working, not sure why. The problem occurs if I point the CQWP at the whole site collection. The GUi just says 'there is a problem with the query' but looking at the ULS the error is SQL based and something to do with UNIONS and INTERSECTS, it basically seems to be a problem that occurs if the CQWP is trying to return CTs with different properties. I did make changes to the CT during development so that sounded plausible.
I then narrowed the problem down to a specific web but I am trying to find out what it is about this subweb that caused the problem. When I pointed the CQWP at a different subweb with the same CT deployed it was fine.
Things i have tried:
- I deleted the list that used the CT in the problem web and recreated a new list, and redeployed the CT.
- I have run some powershell code that returns all the CTs used in that subweb and my FAQ CT only shows once, it has the ID I expect it to have
- I deleted everything from the Recycle Bin (in the subweb and even in the whole of CA) in case there was a cached version of the CT in a deleted list somewhere, made no difference.
- I tried point the CQWP specifically at the list in the problem web that uses the FAQ CT, when I did this the CQWP returned the expected results, it is only when I expose the CQWP to the whole of the problem web that it fails (and so obviously it fails when I expose it to the whole Site collection too).
I have run out of ideas, any suggestions of what to try next?
<< UPDATE >>
After more detective work it appears the problem is not specifically with the Content Type, the error also occurs if I point the CQWP at the 'problem web' and attempt to return All Content Types from ANY Custom Lists. It works fine for other types, such as Doc Libraries and Contacts. Curiouser and curiouser...