Unexpected parent tag association

by bobthechemist   Last Updated May 18, 2016 08:04 AM

I'm using 3.3.0 and started playing with the tags. I've noticed that all of the tags recently created have the Joomla tag as their parent. When I edit the tag, the Parent pull down menu is set to None; however if I Unpublish the Joomla tag, then the subsequent tags get unpublished as well (and cannot be published until I publish the Joomla tag). Is this expected behavior?


Some screen shots

Components => Tags

I've unpublished the tag Joomla which also unpublishes most of my other tags (oddly, not the Baking, although that one was added at a different time than the others, leading me to believe that something has changed in the meantime). If I click on the status of SciLab, it will not change. If I toggle the status of Joomla, all (save for Baking) follow suit.

enter image description here

Components => Tags => SciLab

No parent is set. Here I can publish the tag, and it seems to persist until I toggle the Joomla tag; Joomla is still behaving like the parent.

enter image description here

Components => Tags => Baking

Why baking isn't sharing the fate of all my other tags is beyond me.

enter image description here


In response to answer by @FFrewin

Here is a screenshot of my jos_tags table. It looks as if there are problems with the lft/rgt values. Additionally, the Path shows that Joomla is the parent of all the tags, even though Baking is not behaving as if it has a parent.

enter image description here



Answers 1


If there are not any other hacks on the code that affect the save functions of the component, then this issue makes me think that something can be messed up in the Nested Set Model in the jos_tags table.

You will need to check your tags db_table with a tool like phpmyAdmin, to see about those values, and maybe if you need further advise, post here a screenshot of tags table columns for further investigation.

For more info, check this very good article that exlains the Nested Set Model concept. A good read for everyone.

The Nested Set Model diagram:

The Nested Set Model diagram


Your Joomla Tags table

But in a brief, if all your tags are those I see in the screenshot, you should expect to see something similar to the screenshot I post here.

What you should care more from my screenshot is the parent_id (of course), the lft, rgt, level and path values. right tags table for the question
Since you want all your tags be children of the root tag (meaning having no other tags as parent), then they should be all set to level=1 and parent_id = 1. For lft and rgt values, then you all your tags should have numbers with no larger difference than 1, between their left/right values, while ROOT should have the lft value set to 0 and the right set to the higher number of this calculation: "(total number of tags * 2) -1".

Generally there is not an easy way to deal with this for the com_tags. If it happens that you just have only a few tags, then you could edit the lft/rgt values by hand (of course after have calculate them). If you have an extended number of tags, then you would probably have to look to write a php script, that will calculate and set those values properly.

Hope this helps and will not be too much confusing.

To be more specific - follow these steps:

Set ROOT lft/rgt 0-13, Joomla lft/rgt to 1-2 baking 3-4 and continue like this till your last tag travel which should be 11-12. Also remove from the path the joomla and the slash part. But in any case - first take a backup of your db.

FFrewin
FFrewin
June 17, 2014 15:15 PM

Related Questions


Assign cloud tags results page layout

Updated March 17, 2017 16:10 PM



RSS Feed for TAGS with invalid content URLS

Updated December 18, 2017 12:10 PM

Modify Joomla Tags Result Page

Updated March 27, 2015 14:19 PM