yeah
you shouldnot use Tag.id inside containable! just call it id etc

On 24 Sep., 20:06, cricket <zijn.digi...@gmail.com> wrote:
> On Thu, Sep 23, 2010 at 7:49 PM, Thomas <raz.do...@gmail.com> wrote:
> > Hi,
> > I have a Cake application that's running perfectly on my local
> > machines - Windows7 and Os/X (both have XAMPP 1.7.1 with PHP 5.2.9).
> > I tried to deploy it on a shared hosting environment (PHP 5.2.14) and
> > it is mostly ok.. However, I get two failures that I can't resolve and
> > would really appreciate any help.
>
> > 1) I am using 'Containable' in the following manner:
> > In app/app_model.php, I specify
> > var $actsAs = array('containable');
>
> > In the 'Item' model: var $hasAndBelongsToMany = array('Tag');
>
> > In the 'Tag' model: var $hasAndBelongsToMany = array('Item');
>
> > In my controller:
> > $this->Item->contain('Tag');
> > $items = $this->Item->find('all',array(
> >                        'order' =>array('Item.created DESC'),
> >                        'contain' => array('Tag.id','Tag.name')));
>
> > This works very well on my local machines, but once deployed to the
> > shared hosting I get:
>
> > Warning (512): Model "Item" is not associated with model "Tag" [CORE/
> > cake/libs/model/behaviors/containable.php, line 363]
>
> > And the SQL generated only gets the items - not the tags.
>
> Weird. First thing I'd do is delete everything in app/tmp/models dir.
> Next, check that your model files on the server are up to date. Ditto
> for the DB tables.
>
> And, possibly, there's an issue with that Containable syntax. That's
> not how I use it.Do you have the exact same version of Cake on the
> server as locally? FWIW, this is how I use Containable:
>
> $items = $this->Item->find(
>         'all',
>         array(
>                 'order' =>array('Item.created DESC'),
>                 'contain' => array(
>                         'Tag' => array(
>                                 'fields' => array(
>                                         'Tag.id',
>                                         'Tag.name'
>                                 )
>                         )
>                 )
>         )
> );
>
> > 2) I am also using the markdown parser class.
> > I have Markdown_Parser.php in my vendors folder, defining a class
> > called Markdown_Parser.
> >  load it in a component like so:
>
> > if (!class_exists('Markdown_Parser')) {
> >    App::import('Vendor', 'MarkdownParser');
> > }
> > $this->parser = new Markdown_Parser(); //This is line 36
>
> > When I call the parser from the controller I get:
>
> > Fatal error: Class 'Markdown_Parser' not found in /home/narp/
> > public_html/yarp/app/controllers/components/markdown.php on line 36
>
> Try passing the path, relative to vendors dir, to the class. eg.
>
> App::import('Vendor', 'phpThumb', false, null, 'phpThumb/phpthumb.class.php');

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to