BZ1160658: Guided Rule Editor deletes first and last character of the formula after refresh

(cherry picked from commit 0833ddd153f72aad0a29f8c41a92a52dc6e265e7)