When doing a contains filter on a view, it may not return expected results if it contains a printf identified such as %s. I discovered this when filtering for spanish was not working yet english was fine, while both where in the database. I tracked it down to the fact that in views_build_view, it grabs the query using _views_get_query, which already has substituted the arguments into the query. Then views_build_view goes on to substitute them again when it goes to run the query, breaking my query for spanish as the "like '%spanish%' ends up with the %s substituted again. It looks to me like the code should instead call _views_build_query, which does not yet have the arguments substituted into the query. I've attached a patch to views.module which does this; it solves my problems and does not seem to break anything else.
| Comment | File | Size | Author |
|---|---|---|---|
| views-broken-args.patch | 122 bytes | koshea |
Comments
Comment #1
merlinofchaos commentedThis is already fixed in -dev. Also, your patch isn't against cvs, isn't a unified diff, and doesn't include -p. And it's not the right fix, either. Please only roll patches against the -dev version, where you would have found that this bug doesn't exist.
Comment #2
koshea commentedSorry for that, I don't think there is currently a dev snapshot of the drupal 5 branch available so I guess I missed it, just trying to help.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.