{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/5659","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/5659/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/5659/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/5659/events","html_url":"https://github.com/cakephp/cakephp/issues/5659","id":54195742,"number":5659,"title":"3.0 custom i18n-Tables stopped working","user":{"login":"Soswald","id":3344683,"avatar_url":"https://avatars.githubusercontent.com/u/3344683?v=3","gravatar_id":"","url":"https://api.github.com/users/Soswald","html_url":"https://github.com/Soswald","followers_url":"https://api.github.com/users/Soswald/followers","following_url":"https://api.github.com/users/Soswald/following{/other_user}","gists_url":"https://api.github.com/users/Soswald/gists{/gist_id}","starred_url":"https://api.github.com/users/Soswald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soswald/subscriptions","organizations_url":"https://api.github.com/users/Soswald/orgs","repos_url":"https://api.github.com/users/Soswald/repos","events_url":"https://api.github.com/users/Soswald/events{/privacy}","received_events_url":"https://api.github.com/users/Soswald/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/documentation","name":"documentation","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/7","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/7/labels","id":453043,"number":7,"title":"3.0.0","description":"New major release that breaks compatibility with 2.x\r\n\r\n- PHP5.4.19+\r\n- New ORM & behaviors.\r\n- Improved Routing\r\n- PSR-0 and composer support.\r\n- Simpler configuration and bootstrapping.\r\n- Improved configuration handling.\r\n- Improved bake.\r\n\r\nSee [the roadmap](http://github.com/cakephp/cakephp/wiki/3.0-roadmap) for more details.","creator":{"login":"lh-import","id":5175817,"avatar_url":"https://avatars.githubusercontent.com/u/5175817?v=3","gravatar_id":"","url":"https://api.github.com/users/lh-import","html_url":"https://github.com/lh-import","followers_url":"https://api.github.com/users/lh-import/followers","following_url":"https://api.github.com/users/lh-import/following{/other_user}","gists_url":"https://api.github.com/users/lh-import/gists{/gist_id}","starred_url":"https://api.github.com/users/lh-import/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lh-import/subscriptions","organizations_url":"https://api.github.com/users/lh-import/orgs","repos_url":"https://api.github.com/users/lh-import/repos","events_url":"https://api.github.com/users/lh-import/events{/privacy}","received_events_url":"https://api.github.com/users/lh-import/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":2137,"state":"open","created_at":"2013-10-11T20:56:23Z","updated_at":"2015-01-13T14:09:13Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-01-13T13:52:53Z","updated_at":"2015-01-13T14:10:26Z","closed_at":null,"body":"When trying to get a list including translations via\r\n```php\r\n$this->set('countries', $this->paginate($this->Countries->find('translations')));\r\n```\r\nit fails with\r\n```\r\nSQLSTATE[42S02]: Base table or view not found: 1146 Table '**DATABASE**.countries-i18n' doesn't exist\r\n```\r\nfor my CountriesTable, which is initialized with\r\n```php\r\n    public function initialize(array $config) {\r\n        $this->addBehavior('Translate', [\r\n            'fields' => ['name'],\r\n            'translationTable' => 'countries_i18n'\r\n        ]);\r\n        $this->table('countries');\r\n        $this->displayField('name');\r\n        $this->primaryKey('id');\r\n    }\r\n```\r\n\r\nwhich points to a MySQL table, set up according to the book.\r\n\r\nThe error page states\r\n```\r\nPlease try correcting the issue for the following table aliases:\r\n\r\ncountries_i18n\r\nCountries_name_translation\r\ncountries-i18n\r\n```\r\nI think `countries-i18n` should not be there.\r\n\r\nThe last statement in the SQL-Log is:\r\n```sql\r\nSHOW FULL COLUMNS FROM `countries-i18n`\r\n```\r\nBut this table doesn't exist, nor should it exist I think, because I set the translations table to be `countries_i18n`, which seems to work, acording to the first statement in the SQL-log is taken correctly.\r\n```sql\r\nSELECT Countries.id AS `Countries__id`, Countries.name AS `Countries__name`, \r\nCountries.code AS `Countries__code`, Countries.fright_rate AS `Countries__fright_rate`, \r\nCountries.labour_rate AS `Countries__labour_rate`, \r\nCountries_name_translation.id AS `Countries_name_translation__id`, \r\nCountries_name_translation.locale AS `Countries_name_translation__locale`, \r\nCountries_name_translation.model AS `Countries_name_translation__model`, \r\nCountries_name_translation.foreign_key AS `Countries_name_translation__foreign_key`, \r\nCountries_name_translation.field AS `Countries_name_translation__field`, \r\nCountries_name_translation.content AS `Countries_name_translation__content` \r\nFROM countries Countries \r\nLEFT JOIN countries_i18n Countries_name_translation \r\nON (Countries_name_translation.model = 'Countries' AND Countries_name_translation.field = 'name' AND Countries_name_translation.locale = 'de' AND Countries.id = (Countries_name_translation.foreign_key)) LIMIT 20 OFFSET 0\r\n```\r\nIf more information or logs are needed, I be glad to assist.\r\n"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/69748751","html_url":"https://github.com/cakephp/cakephp/issues/5659#issuecomment-69748751","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/5659","id":69748751,"user":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T14:10:26Z","updated_at":"2015-01-13T14:10:26Z","body":"I suggest the model to be baked, though. That way you can control things like the default connection name."}}