there is 3 tables
article, author and university

I'm making a grid for table article. Every article belongs to one author and every author belongs to one university. I need to show University.name | Author.name | Article.\*

At admin view

```
$gridWidget=$this->widget('bootstrap.widgets.TbGridView',array(
    'id'=>'dados-cd-grid',
    'dataProvider'=>$model->search(),
    'filter'=>$model,
    'columns'=>array(
        'author_name'=>array(
            'name' => 'author_name',
            'value' => '$data->author->name'
        ),
        'university_name'=>array(
            'name' => 'university_name',
            'value' => '$data->university->author->name'
        ),
            ...
array(
            'class'=>'bootstrap.widgets.TbButtonColumn',
        ),
    ),
)); 

```

And at article model I have

```
public $author_name;
public $university_name;

public function rules()
    {
        ...
        return array(
            array('author.name, university.name, ... ', 'safe', 'on'=>'searc

h'),
         ...
            );
    }
public function search()

{

    $criteria=new CDbCriteria;

    $criteria->with = array( 'author','author.university' );

    $criteria->compare('author.name',$this->author_name,true);
    $criteria->compare('university.name',$this->university_name,true);

    ...

    return new CActiveDataProvider($this, array(
        'criteria'=>$criteria,
        'sort'=>array(
            'attributes'=>array(
                'author_name'=>array(
                    'asc'=>'author.name',
                    'desc'=>'author.name DESC',
                ),
                'university_name'=>array(
                    'asc'=>'university.name',
                    'desc'=>'university.name DESC',
                ),
                '*',
            ),
        ),
    ));
}

```

The grid is working perfect fine. However when I try to search or order by author\_name I got a error message. I'll try to translate the error message from portuguese but I don't know if it is like that in english: "Undefined table:7 Error: missing entry for table author"

The funny part is that the university search and order is working just fine. And I can't see the diference between they.

Anyone can help me?

Edited
======

I already checked if the column name in database is really "name"
At the error message it's showing part of the query is saying "(WHERE author.name LIKE ycp0)". I think this is the key of my prioblem but I dont know exactly how.

Edited
======

Error message
Error 500: CDbException
============

CDbCommand falhou ao executar o comando SQL: SQLSTATE[42P01]: Undefined table:7 ERRO: faltando entrada para tabela "autor" na cláusula FROM LINE 1: ..."autor"."universidade\_id"="universidade"."id") WHERE (auto...

^.The SQL statement executed was SELECT COUNT(DISTINCT 't'.'id') FROM "artigo" 't' LEFT OUTER JOIN 'autor' 'autor' ON ('t'.'artigo'.'autor\_id'='autor'.'id') LEFT OUTER JOIN 'universidade' 'universidade' ON ('autor'.'universidade\_id'='universidade'.'id') WHERE (autor.nome LIKE: ycp0)