How to fix my error: Show and set rules and queries only work with element functions

There is a topic on migrating from locate to context here, might be useful: How to use context instead of a callback function in locate function calls?