Thursday, December 30, 2010

Re: $useTable problem

My solution ended up being to take a few steps back then start over.
But this time I added the migrations plugin first. The other thing I
did different is I went with only one category per post instead of
multiple.

After doing the migration I had to fix a few minor things, such as
adding a category_id field in the blogs table. And adding the
association to the Blog model. Adding Auth to the components array for
CategoriesController. Fixing forms. There was a missing paging.ctp
form, which I grabbed from another plugin. Now it works.

On Dec 30, 9:58 pm, john lyles <confidentia...@gmail.com> wrote:
> I can't see any misspellings. My associations are as follows:
>
> class Category ...
> public $belongsTo = array(
>                 'ParentCategory' => array('className' => 'Categories.Category',
>                         'foreignKey' => 'category_id',
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => ''));
> public $hasMany = array(
>                 'ChildCategory' => array(
>                         'className' => 'Categories.Category',
>                         'foreignKey' => 'category_id',
>                         'dependent' => false));
>
> class Categorized ....
> public $belongsTo = array(
>                 'Category' => array(
>                 'className' => 'Categories.Category'));
>
> class Blog...
> public $hasAndBelongsToMany = array(
>         'Category' => array(
>             'className' => 'Categories.Category',
>             'foreignKey' => 'foreign_key',
>             'associationForeignKey' => 'category_id',
>            'with' => 'Categorized'
>
> I tried adding the 'joinTable' key set to 'categorized' but this made
> no difference.
>
> On Dec 30, 9:20 pm, "Larry E. Masters" <php...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Did you define the association correctly? Check that you do not have any
> > typos.
>
> > --
> > Larry E. Masters
>
> > On Thu, Dec 30, 2010 at 8:17 PM, john lyles <confidentia...@gmail.com>wrote:
>
> > > No. I used the schema shell: cake schema create -plugin categories -
> > > name categories
>
> > > On Dec 30, 8:56 pm, "Larry E. Masters" <php...@gmail.com> wrote:
> > > > did you run the migrations to setup the tables?
>
> > > > --
> > > > Larry E. Masters
>
> > > > On Thu, Dec 30, 2010 at 7:53 PM, john lyles <confidentia...@gmail.com
> > > >wrote:
>
> > > > > Hi cakers,
>
> > > > > I'm using the categories plugin from cakeDC. In the plugin there is a
> > > > > model called Categorized and the $useTable variable is set to
> > > > > 'categorized'. But when I go to /blogs/add I get the following error:
> > > > > Error: Database table categorizeds for model Categorized was not
> > > > > found.
>
> > > > > What can cause this?
>
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscr...@googlegroups.c om>
> > > <cake-php%2Bunsubscr...@googlegroups.c om>For more options, visit this
> > > group at
> > > > >http://groups.google.com/group/cake-php?hl=en
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscr...@googlegroups.c om>For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: