Development

#3142 (RemoveAllTags directly followed by addTag is bugging)

You must first sign up to be able to contribute.

Ticket #3142 (closed defect: invalid)

Opened 4 months ago

Last modified 4 months ago

RemoveAllTags directly followed by addTag is bugging

Reported by: jug Assigned to: xavier
Priority: minor Milestone:
Component: sfPropelActAsTaggablePlugin Version: 1.0.10
Keywords: Cc:
Qualification: Unreviewed

Description

Hi,

While doing this in my OperationActions class :

  public function executeTag()
  {
    $tags = $this->getRequestParameter('tag');
    $operation = OperationPeer::retrieveByPk( $this->getRequestParameter('id') );
    if ( strlen($tags) )
    {
      $operation->removeAllTags();
      $operation->addTag( $tags );
      $operation->save();
    }
    return $this->renderText( implode(', ',$operation->getTags() ) );
  }

I had problems when a tag had to be removed and added in the same time... (first tag was not saved when a comma separated list was given and this first one already exist) (All tags where definitely removed when trying to add/remove the same list of tags)

So I made some changement as you will see in the attached file.

Bye

Attachments

sfPropelActAsTaggableBehavior.class.php (11.7 kB) - added by jug on 03/17/08 15:19:56.

Change History

03/17/08 15:19:56 changed by jug

  • attachment sfPropelActAsTaggableBehavior.class.php added.

03/18/08 09:01:26 changed by jug

  • status changed from new to closed.
  • resolution set to invalid.

Forget that... I'm not sure of it any more. If, I will reopen! Thank's