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 ?

4 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.

  • 0
Posted (edited)

Hello all,

when digging deeper into tags, I came across this post. I show all tags on my product pages. To make it easy for customers, I manually managed tags to have ID's in some ranges and they are then displayed according to the tag IDs in ascending orders. So the would ideally appear in an order like this one:

BRAND (Range 0 to 30000)
Year-of-Production (Range 30001 to 39999)
Age (Range 40000 to 49999)

But I see that some products get some kind of random new tag IDs. It looks to me that only products are affected from this behavior when the tag is only 1x assigned.
The result of this is randomly changing order of tags.

Edited by Scully

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...