Using TranslateBehavior?

37 views
Skip to first unread message

Le Luyen

unread,
Feb 2, 2016, 5:15:40 PM2/2/16
to QuickApps CMS
Hi Chris,

I used the TranslateBehavior  for content_types, terms, vocabularies tables?

Have problem when I creating a content with content_type have term and the language is not 'en_US'.

"Error: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous

If you are using SQL keywords as table column names, you can enable identifier quoting for your database connection in config/app.php.

SQL Query:

SELECT Terms.name AS Terms__name, Terms_name_translation.id AS Terms_name_translation__id, Terms_name_translation.content AS Terms_name_translation__content FROM terms Terms LEFT JOIN terms_i18n Terms_name_translation ON (Terms_name_translation.model = :c0 AND Terms_name_translation.field = :c1 AND Terms_name_translation.locale = :c2 AND Terms.id = (Terms_name_translation.foreign_key)) LEFT JOIN terms_i18n Terms_description_translation ON (Terms_description_translation.model = :c3 AND Terms_description_translation.field = :c4 AND Terms_description_translation.locale = :c5 AND Terms.id = (Terms_description_translation.foreign_key)) WHERE id in (:c6)
Could this be caused by using Auto-Tables?

Some of the Table objects in your application were created by instantiating "Cake\ORM\Table" instead of any other specific subclass.

This could be the cause for this exception. Auto-Tables are created for you under the following circumstances:

The class for the specified table does not exist.
The Table was created with a typo: TableRegistry::get('Atricles');
The class file has a typo in the name or incorrect namespace: class Atricles extends Table
The file containing the class has a typo or incorrect casing: Atricles.php
The Table was used using associations but the association has a typo: $this->belongsTo('Atricles')
The table class resides in a Plugin but no plugin notation was used in the association definition.

Please try correcting the issue for the following table aliases:

 I18n

ContentTypes_name_translation

ContentTypes_description_translation

Terms_name_translation
Terms_description_translation"

Please help?

Thanks you!



Le Luyen

unread,
Feb 5, 2016, 1:04:58 AM2/5/16
to QuickApps CMS
Hi Chris,

This problem resolved.( Must give alias table name in where condition as Term.id)
Reply all
Reply to author
Forward
0 new messages