Jump to content
thirty bees forum
  • 0

Tags ID are incremented each time a product is modified


Question

Posted

Hello,

Each time a product is edited and saved, Tags ID are changing.

It make non sense to me as i need to add a field/property ('category') to the Tag Object

When my field is added and his value is modified for example : Tag->name = 'economy' Tag->category = 'Article'

When i edit my product Tag->category is lost. When go to catalog>Tags econmy'id value is no more '1' but Two.

I see in adminProductController that Tags are deleted then reassign.

So all previous modification to Object tag are lost and the ID has been incremented. The Method addTags never recognize isobectloaded.

Is it normal ? why ?

3 answers to this question

Recommended Posts

  • 0
Posted

People usually write code which fits their needs. They have no magic crystal ball to find out which other uses one could come up with in the future. The code in question was written in 7/2015 (reformatted later).

Now it's 2017 and you found such an additional use, so this code apparently needs a review. If you can come up with better code, not breaking previous usage, I'm pretty sure it can be accepted for thirty bees 1.1.0.

  • 0
Posted

At first, thanks for your reply,

I've found another solution and now i use features.

For Tags I've found another logic to develop the solution When deleteTags is called create as, $tagremoved and a $tagcategory_removed push in an array as param to addTags() which call the constructor with an array as param for $name then call __construct::ObjectModel

This is what i imagined to keep all the maximum native code. but iswitch for features

But i don't understand the logic to deleted and recreated. the reason why. I see in adminProductController, that i would have to force the association of tag to product in product_tag BEFORE but something get me wrong.

  • 0
Posted

But i don’t understand the logic to deleted and recreated. the reason why.

It's the simplest way to do an update. Such updates happen rarely, so there's no need for performance optimization.

For Tags I’ve found another logic to develop the solution

Code, please! :relaxed: Ideally as a pull request, but patches uploaded here are also welcome.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...