Hi Daniel,
Attached you will find an updated version of the patch for query callback.
Best regards, Alexey Simak