If locally all fine but on server not, it can be wrong models
filenames as always. They must be strictly lowercased.

On Sep 20, 1:31 am, Victor Castellanos <[email protected]>
wrote:
> Hey everyone,
>
> I've been having a lot of troubles trying to set a CakePHP project. My
> hosting service has PHP 5.2.9.
>
> My problem is basically this:
>
> Notice (8): Undefined property: AppModel::$Categoria [APP/controllers/
> items_controller.php, line 297]
>
> Fatal error: Call to a member function find() on a non-object in /home/
> neverminded/public_html/projectname/app/controllers/
> items_controller.php on line 297
>
> The code for that is:
>
> class ItemsController extends AppController {
>
>         var $name = 'Items';
>
> ...
>         function catalogo($id = NULL) {
>
>                 // Llenar los selects del formulario.
>                 // this is line 297 :
>                 $this->set('categorias', $this->Item->Categoria->find('list') 
> );
>
>         }
> ...
>
> }
>
> Item model:
>
> class Item extends AppModel {
>
>         var $name = 'Item';
>
>         var $primaryKey = 'id';
>
>         var $useTable = 'items';
>
>         var $belongsTo = array(
>                 'Categoria' => array(
>                         'className' => 'Categoria',
>                         'foreignKey' => 'id_categoria'
>                 ),
>         );
>
> }
>
> Categoria model:
>
> class Categoria extends AppModel {
>
>         var $name = 'Categoria';
>
>         var $primaryKey = 'id';
>
>         var $useTable = 'categorias';
>
>     var $hasMany = array(
>         'Item' => array(
>             'className'    => 'Item',
>             'foreignKey'    => 'id_categoria'
>         )
>     );
>
> }
>
> -----------------------------------------------------------------
> Another thing that happens is I get this error:
>
> Missing Database Table
>
> Error: Database table contactos for model Contacto was not found.
>
> Notice: If you want to customize this error message, create app/views/
> errors/missing_table.ctp
>
> But my Contacto model has
> class Contacto extends AppModel {
>
>         var $name = 'Contacto';
>
>         var $useTable = false;
>
> }
>
> Notice the $useTable= false.
>
> Weird thing is that locally, the project works fine, but when I run it
> on my production server, which has same specs as my local PC, it gives
> me all this errors, plus sessions are not being saved, don't know why.
>
> Hope someone can help me out with this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to