Tuesday, July 27, 2010

Re: cakeDC Tag Plugin Delete issue

That was one of the first things I tried. However i could not get it
to work since id and tag-id in theged fields are encrypted.

On Jul 15, 7:35 am, Kirk <k...@kirkkahn.com> wrote:
> I think I know what the problem is. It just occurred to me that all you have
> to do is add a condition in the $hasAndBelongsToMany relationship in the
> model to ensure that both the foreign key and the model are matched in the
> Tagged table. This way you can avoid the custom query hack.
>
> ~Kirk
>
> On Wed, Jul 14, 2010 at 10:35 AM, Kirk <k...@kirkkahn.com> wrote:
> > perhaps the problem is that the Taggable behavior has no beforeDelete
> > callback
>
> > On Wed, Jul 14, 2010 at 2:45 AM, abocanegra <aaronbocane...@gmail.com>wrote:
>
> >> I solved it, You can check out the code on my blog
>
> >>http://www.whatartist.com/blog/2010/07/making-cakedc-tags-plugin-dele...
>
> >> On Jul 8, 4:35 am, abocanegra <aaronbocane...@gmail.com> wrote:
> >> > I have been enjoying the Tag Plugin by CakeDC. However, I am having an
> >> > issue when it is utilized across multiple models (i.e Photo, Design,
> >> > Video). When I delete an entry with tags in say Photos it deletes
> >> > based off of foreign_key which is the ID of photos. However, if I also
> >> > have the same ID in Designs or Videos it also deletes those tags. I am
> >> > aware of the options in the actsas function in the model. Still i am
> >> > unable to figure out how to delete based on foreign_key and model =>
> >> > Design ( or the appropriate model in any case ).
>
> >> > Has anybody had experience with this?
>
> >> > my model currently is just using the default:
>
> >> >         var $actsAs = array(
> >> >         'Tags.Taggable');
>
> >> > The additional options on their site are:
>
> >> > var $actsAs = array(
> >> >         'Tags.Taggable' => array(
> >> >                 'separator' => '',
> >> >                 'field' => 'tags',
> >> >                 'tagAlias' => 'Tag',
> >> >                 'tagClass' => 'Tags.Tag',
> >> >                 'taggedClass' => 'Tags.Tagged',
> >> >                 'foreignKey' => 'foreign_key',
> >> >                 'associationForeignKey' => 'tag_id',
> >> >                 'automaticTagging' => true,
> >> >                 'unsetInAfterFind' => false,
> >> >                 'resetBinding' => false,
> >> >         )
> >> > );
>
> >> > This is the last obstacle I have before launching my new site, it
> >> > seems small, but it is quite frustrating.
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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<cake-php%2Bunsubscribe@googlegroups.com>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: