keep filter conditions from being deleted

This a backport of 4dd5b105 from master to 0-6-stable

Ref: #2523, #2832