Wierd problem - CDBCriteria.php fails to load?

I’ve got a strange problem on 1.1.1.

As part of my application I have an Addresses model, each address is associated with a town.

I’m generating a drop-down list of towns upon creating and updating an address with the following code in my _form.php:




echo $form->dropDownList($model,'town_id', CHtml::listData(Towns::model()->TownList, 'id', 'name', 'state'));



TownList is a function in my Towns model as follows:




  public function getTownList()

  {

    $criteria=new CDBCriteria;

    $criteria->select="id, concat(name, ', ', state, ' ', postcode) as name, state";

    $criteria->order='state,name';


    return Towns::model()->findAll($criteria) ;

  }



Now when updating an existing address, everything works as expected - but when trying to create a new address I get the following PHP error:


include(CDBCriteria.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

The create & update actions in my addresses controller are unmodified from the crud generated by yiic and i’m sure i’ve done this before with previous versions.

Is this a bug? Am I using this in the wrong way or is there something else i’m missing?

/me slaps head

I knew it would be something simple - I had misspelt CDbCriteria as CDBCriteria :)

Now whats interesting is why it worked at all on update and not create as it should have had exactly the same error.

In the upgrade file there is written:

Upgrading from v1.0.x


  • Application and module parameter names are changed to be case-sensitive.

In 1.0.x, they are case-insensitive.

But is not what happens to you. Maybe there are more case sensitive than we immagine? :D