?
Referenced as Pull Request for: # 6241
avatar stellainformatica
stellainformatica
27 Feb 2015

Steps to reproduce the issue

Install a fresh version of Joomla 3.4.0 with english sample data.
In administration create some new tags without a parent tag (i.e. apples, pears).
Create a new article and look the list of tags

Expected result

The tags showed are all parent, there are no sub-tags:
Joomla
Apples
Pears

Actual result

The Joomla tag that was created by exemple data is the parent and all others are showed as sub-tags:
Joomla
Joomla/Apples
Joomla/Pears

System information (as much as possible)

Joomla 3.4.0 with englis sample data

Additional comments

avatar stellainformatica stellainformatica - open - 27 Feb 2015
avatar Erftralle
Erftralle - comment - 27 Feb 2015

Confirmed.

During the installation process of Joomla! all SQL commands in installation/sql/mysql/joomla.sql will processed, among others this one:

INSERT INTO `#__tags` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `note`, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `metadesc`, `metakey`, `metadata`, `created_user_id`, `created_time`, `created_by_alias`, `modified_user_id`, `modified_time`, `images`, `urls`, `hits`, `language`, `version`) VALUES
(1, 0, 0, 1, 0, '', 'ROOT', 'root', '', '', 1, 0, '0000-00-00 00:00:00', 1, '', '', '', '', '', '2011-01-01 00:00:01', '', 0, '0000-00-00 00:00:00', '', '', 0, '*', 1);

This creates the ROOT entry in the nested sets table for Tags.

When installing now the sample data of installation/sql/mysql/sample_data.sql we find, among others, the following SQL command:

INSERT IGNORE INTO `#__tags` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `note`, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `metadesc`, `metakey`, `metadata`, `created_user_id`, `created_time`, `created_by_alias`, `modified_user_id`, `modified_time`, `images`, `urls`, `hits`, `language`, `version`, `publish_up`, `publish_down`) VALUES
(1, 0, 0, 3, 0, '', 'ROOT', 'root', '', '', 1, 0, '0000-00-00 00:00:00', 1, '{}', '', '', '', 0, '2011-01-01 00:00:01', '', 0, '0000-00-00 00:00:00', '', '', 0, '*', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
(2, 1, 1, 2, 1, 'joomla', 'Joomla', 'joomla', '', '', 1, 0, '0000-00-00 00:00:00', 1, '{"tag_layout":"","tag_link_class":"label label-info","image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}', '', '', '{"author":"","robots":""}', 849, '2013-11-16 00:00:00', '', 0, '0000-00-00 00:00:00', '', '', 0, '*', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00');

As the ROOT entry has already been created its insertion will be ignored without throwing an error.
Unfortunately now the lft, rgt values of the two data sets are not consistent after that and exactly this leads to the problem you described.

The solution for that is just to truncate the tags table before inserting the sample data means

TRUNCATE TABLE `#__tags`;
INSERT IGNORE INTO `#__tags` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `note`, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `metadesc`, `metakey`, `metadata`, `created_user_id`, `created_time`, `created_by_alias`, `modified_user_id`, `modified_time`, `images`, `urls`, `hits`, `language`, `version`, `publish_up`, `publish_down`) VALUES
(1, 0, 0, 3, 0, '', 'ROOT', 'root', '', '', 1, 0, '0000-00-00 00:00:00', 1, '{}', '', '', '', 0, '2011-01-01 00:00:01', '', 0, '0000-00-00 00:00:00', '', '', 0, '*', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
(2, 1, 1, 2, 1, 'joomla', 'Joomla', 'joomla', '', '', 1, 0, '0000-00-00 00:00:00', 1, '{"tag_layout":"","tag_link_class":"label label-info","image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}', '', '', '{"author":"","robots":""}', 849, '2013-11-16 00:00:00', '', 0, '0000-00-00 00:00:00', '', '', 0, '*', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00');

Opened pull request #6241 with a fix.

avatar brianteeman brianteeman - change - 27 Feb 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 1 Mar 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-03-01 10:48:11
Closed_By brianteeman
avatar brianteeman brianteeman - close - 1 Mar 2015
avatar brianteeman brianteeman - close - 1 Mar 2015
avatar brianteeman
brianteeman - comment - 1 Mar 2015

See #6241


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6216.

Add a Comment

Login with GitHub to post a comment