Ticket #2165 (new enhancement)
Can't make any other db fields translatable
| Reported by: | mpeel | Owned by: | ischommer |
|---|---|---|---|
| Priority: | critical | Milestone: | 2.3.1 |
| Component: | (Unknown) | Version: | 2.2.0 |
| Severity: | medium effort / impact | Keywords: | |
| Cc: | Hours: |
Description
You can't add Translatable to any sub-class of SiteTree?, or the site fails to load in the translated languages.
e.g.
<?php
class Page extends SiteTree {
static $db = array(
"TestField" => "Text"
);
static $extensions = array(
"Translatable('TestField')",
);
}
This, when switching to the translated language (e.g. in the CMS), or implementing a method that checks if a page exists in other languages, causes SQL to die with weird errors - e.g. 'Page_lang_Live.OriginalLangID' doesn't exist (when it blatently does in the database).
I sort of got to a solution, but need to get this site out and can't investigate further.
FWIW, I noticed that if you specify extensions on sub-classes, it seems to call augmentSQL() twice, which is going to break quite a bit of Translatable (e.g. there are some lines which indiscriminately replace '.ID' with '.OriginalLangID' without checking if that table even has the column in the first place.
