Please attach a copy of the page generating the error. I'd like to look at the first 31 lines of that file anyway to see where the filterdef variable is being added and what context it is used in.
If you attach a zipped copy of the file I can take a look and probably give some advice.