Tree Error for Tags - Wrong ID for sub items

edited July 2016 in Bug Reports
Hi,

I'm trying out the built in tags feature of fuelcms. I have created some sample articles and sample tags. I enabled the tree function written below

function tree()
{
return $this->_tree('has_many');
}

When I check the tree section, it is showing the tree appropriately like below

- Tag 1
   | article 1
- Tag 2
   | article 1
   | article 2
   | article 3

When I try to click/visit each article, the id of the article is incorrect. It seems it is using the tag id instead. Please check below.

- Tag 1 [http://localhost/fuelcms/admin/tags/edit/1]
   | article 1 [http://localhost/fuelcms/admin/articles/edit/1]
- Tag 2 [http://localhost/fuelcms/admin/tags/edit/2]
   | article 1 [http://localhost/fuelcms/admin/articles/edit/2]
   | article 2 [http://localhost/fuelcms/admin/articles/edit/2]
   | article 3 [http://localhost/fuelcms/admin/articles/edit/2]

Upon checking/testing, the appropriate data is being fetched. But instead of the candidate id (http://localhost/fuelcms/admin/articles/edit/[candidate_id]) being generated for the urls, foreign_id (tag_id) is being used (http://localhost/fuelcms/admin/articles/edit/[tag_id]). Details below.

array (size=2)
   'candidate_table' => string 'articles' (length=8)
   'foreign_table' => string 'fuel_tags' (length=9)
array (size=4)
   0 =>
     array (size=18)
       'candidate_id' => string '1' (length=1)
       'candidate_title' => string 'article 1' (length=9)
       'candidate_slug' => string 'article-1' (length=9)
       ...
       'foreign_id' => string '1' (length=1)
       ...
   1 =>
     array (size=18)
       'candidate_id' => string '1' (length=1)
       'candidate_title' => string 'article 1' (length=9)
       'candidate_slug' => string 'article-1' (length=9)
       ...
       'foreign_id' => string '2' (length=1)
       ...
   2 =>
     array (size=18)
       'candidate_id' => string '2' (length=1)
       'candidate_title' => string 'article 2' (length=9)
       'candidate_slug' => string 'article-2' (length=9)
       ...
       'foreign_id' => string '2' (length=1)
       ...
   3 =>
     array (size=18)
       'candidate_id' => string '3' (length=1)
       'candidate_title' => string 'article 3' (length=9)
       'candidate_slug' => string 'article-3' (length=9)
       ...
       'foreign_id' => string '2' (length=1)
       ...

Please let me know if I missed out some configuration or the process to fix this.

Comments

Sign In or Register to comment.