Ticket #2267 (new patch)
Patch to fix i18n and SearchForm not working together
| Reported by: | mpeel | Owned by: | ischommer |
|---|---|---|---|
| Priority: | medium | Milestone: | 2.3.1 |
| Component: | i18n | Version: | 2.2.1 |
| Severity: | medium effort / impact | Keywords: | |
| Cc: | Hours: |
Description
Problem: You can't search based on the language you're browsing in,
This is a partial fix to this problem. Because it's to fix the search engine, something I know very little about, it needs to be tested a lot. Specifically, my hack to SQLQuery for unlimtedRowCount() is dangerous and 99% doesn't work - however I don't have time right now to get it right, and the site I did this for has no pagination anyway.
The main issues here was that SQLQuery::unlimitedRowCount() doesn't call SiteTree::extend('augmentSQL'), meaning that Translatable::augmentSQL() doesn't fire on that particular cloned SQLQuery, and therefore it gets data from the wrong tables (and looks for fields that don't exist etc).
The other problem was that SearchForm? itself wasn't namespacing the MATCH() declarations, which meant when you joined multiple tables (lang to original lang etc) it would find ambiguous fields.
