Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:07:26+00:00 2026-06-07T21:07:26+00:00

I have followed Yii extension: Multilingual-behavior instructions typically, and here is my model behavior

  • 0

I have followed Yii extension: Multilingual-behavior instructions typically, and here is my model behavior config:

public function behaviors() 
{
    return array(
        'ml' => array(
            'class' => 'application.models.behaviors.MultilingualBehavior',
            'langClassName' => 'CandidateLang',
            'langTableName' => 'candidatelang',
            'langForeignKey' => 'candidate_id',
            'langField' => 'lang_id',
            'localizedAttributes' => array('name', 'birth_place', 'home_city', 'intro'), //attributes of the model to be translated
            'localizedPrefix' => 'l_',
            'languages' => Yii::app()->params['languages'], // array of your translated languages. Example : array('fr' => 'Français', 'en' => 'English')
            'defaultLanguage' => 'en', //your main language. Example : 'fr'
            'createScenario' => 'insert',
            'localizedRelation' => 'i18nCandidate',
            'multilangRelation' => 'multilangCandidate',
            'forceOverwrite' => false,
            'forceDelete' => true, 
            'dynamicLangClass' => true, //Set to true if you don't want to create a 'PostLang.php' in your models folder
        ),
    );
}

I get a CDbException: The table “{{candidatelang}}” for active record class “CandidateLang” cannot be found in the database.

Here is where the error triggered:

private $_model;
2253 
2254     /**
2255      * Constructor.
2256      * @param CActiveRecord $model the model instance
2257      */
2258     public function __construct($model)
2259     {
2260         $this->_model=$model;
2261 
2262         $tableName=$model->tableName();
2263         if(($table=$model->getDbConnection()->getSchema()-   >getTable($tableName))===null)
2264             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2265                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2266         if($table->primaryKey===null)
2267         {
2268             $table->primaryKey=$model->primaryKey();
2269             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2270                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2271             else if(is_array($table->primaryKey))
2272             {
2273                 foreach($table->primaryKey as $name)
2274                 {
2275                     if(isset($table->columns[$name]))
2276                         $table->columns[$name]->isPrimaryKey=true;

I have made sure the table is there and double checked the casing and the spelling. I even tried putting different table names from the schema without any luck!! So my guess that this call is causing the error:
$model->getDbConnection() , but i don’t know Why or How to fix it??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:07:28+00:00Added an answer on June 7, 2026 at 9:07 pm

    I had the same problem and i fixed it. In the main config set tablePrefix => '' and the problem should be fixed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed the instructions here . To cut a long story short, I
I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get
I have followed the installation instructions as shown here to install the FedOne server,I
I have followed the instructions found at http://code.google.com/p/pubsubhubbub/wiki/DeveloperGettingStartedGuide to setup a hub. When I
I have followed scott's gu tutorial here I uploaded the whole database to my
I have followed the answer provided here to create a drop shadow for my
I have followed the instructions at http://www.javacodegeeks.com/2011/01/advanced-smartgwt-tutorial-part-1.html and tried to create a simple screen
I have followed the instructions from this SO question: How to change the text
I have followed the instructions and have tried to install simple-private-messages gem for Rails
I have followed the instructions on this page to get started on ActionMailer. After

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.