Tags plugin does not work with J! table

jfquestiaux

Well-Known Member
Hi,
The idea to use the #__tags table to store the tags generated in Fabrik was a good one, but unfortunately it does not work: upon save, tags are not saved in #__tags and in the "repeat" file, the tag_id is NULL.

So the issue is really in the insertion of the tags in the J! table.

This is the error reported by the $tagModel object (on line 455):

[_errors:protected] => Array
(
[0] => exception 'UnexpectedValueException' with message 'TagsTableTag::_getNode(1, ) failed.' in /home/realadminjoom/public_html/libraries/joomla/table/nested.php:1523
Stack trace:
#0 /home/realadminjoom/public_html/libraries/joomla/table/nested.php(768): JTableNested->_getNode(1)
#1 /home/realadminjoom/public_html/administrator/components/com_tags/tables/tag.php(254): JTableNested->store(false)
#2 /home/realadminjoom/public_html/administrator/components/com_tags/models/tag.php(343): TagsTableTag->store()
#3 /home/realadminjoom/public_html/plugins/fabrik_element/tags/tags.php(455): TagsModelTag->save(Array)
#4 /home/realadminjoom/public_html/components/com_fabrik/models/form.php(1806): PlgFabrik_ElementTags->onFinalStoreRow(Array)
#5 /home/realadminjoom/public_html/components/com_fabrik/models/form.php(1838): FabrikFEModelForm->processElements()
#6 /home/realadminjoom/public_html/components/com_fabrik/models/form.php(1244): FabrikFEModelForm->processToDB()
#7 /home/realadminjoom/public_html/components/com_fabrik/controllers/form.php(241): FabrikFEModelForm->process()
#8 /home/realadminjoom/public_html/libraries/legacy/controller/legacy.php(702): FabrikControllerForm->process()
#9 /home/realadminjoom/public_html/components/com_fabrik/fabrik.php(181): JControllerLegacy->execute('process')
#10 /home/realadminjoom/public_html/libraries/cms/component/helper.php(405): require_once('/home/realadmin...')
#11 /home/realadminjoom/public_html/libraries/cms/component/helper.php(380): JComponentHelper::executeComponent('/home/realadmin...')
#12 /home/realadminjoom/public_html/libraries/cms/application/site.php(191): JComponentHelper::renderComponent('com_fabrik')
#13 /home/realadminjoom/public_html/libraries/cms/application/site.php(230): JApplicationSite->dispatch()
#14 /home/realadminjoom/public_html/libraries/cms/application/cms.php(257): JApplicationSite->doExecute()
#15 /home/realadminjoom/public_html/index.php(49): JApplicationCms->execute()
#16 {main}

This is tested on latest J!/Fabrik from GitHub.
 
Hmm...It's working fine on my site

You mean tags element plugin?
I just tested with Table for tag = empty and with explicitly selecting #__tags - both is ok.
 
Hi Troester.
Yes, it's the tags element plugin and I tested on two different sites.
Maybe there is something more subtle in this: either a collation or engine conflict in the database OR an upgrade problem. Both sites I used to test were older J! sites updated to 3.6.2. But as you know the latest J! upgrade process, form 3.4.x to 3.5.x to 3.6.0 to 3.6.2 was not an easy ride so maybe there is something there. The error message reports an error in a J! lib file anyway.
I should test with a new J! site to see the difference, then on a site with an FTP upgrade of Joomla!.
 
I can't replicate this either. Works fine for me, on a site that started life as J! 3.4.

Couple of questions ...

Does it work inserting tags through the J! backend tag manager?

Is the tag table empty? This is the only case I can't really test without trashing my existing tests.

I'd suggest putting some debug code in there, dump (string)$query before the loadObject(), see what it's actually trying to execute.

-- hugh
 
With an empty (truncated) #_tags I don't see an error but the (new) tag is not saved.
The #_tags table needs at least the ROOT entry.
 
Yeah, the J! installer adds that ...

C:\xampp\htdocs\joomla34\administrator\components\com_admin\sql\updates\mysql\3.1.0.sql

Code:
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);

So I guess I should have said "is the tags table empty, except for the ROOT entry". :)

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top