Tags as Terms

3 views
Skip to first unread message

rick c

unread,
Nov 25, 2009, 10:59:43 AM11/25/09
to habari-users
For anyone using the development version of Habari:

As you may know, one of the goals for Habari 0.7 is to implement
taxonomy. One aspect of this is implementing tags as terms in a tags
vocabulary. We've been working on this in a branch. It now seems to be
at a usable state, so the changes were merged into trunk in r3829 and
r3830. The code needs some love yet, but maybe with it in trunk, it
will get more.

As with all major updates, I'd recommend backing up your db before
doing svn up. The update should be seamless, moving your tags and
tag2post tables into the terms and object_terms tables respectively.
The tags and tag2posts tables are *not* deleted. They are still in
your database, but they are no longer registered.

One unavoidable side effect of this change is that any plugins or
themes that use direct access to the database to get tags will need to
be updated to use the new table structure. In other words, until they
are updated they will break. If the plugin or theme uses the api
rather than direct database access, it should be okay. One possible
common instance is

$tags = DB::get_results( 'SELECT * FROM ' . DB::table('tags') );

This will no longer work. Instead use

$tags = Tags::get();

More complex SQL will still require SQL. The new SQL will be more
complex than what you are using now. See the post on this subject to
the -dev list for more details

http://groups.google.com/group/habari-dev/t/c62e38ed828093dc

One other change, we tried to make tags something that isn't limited
to posts, so in the future, if this was done right, plugin authors
will be able to tag other object types that may be added.

Rick

Balazs Koren

unread,
Nov 25, 2009, 4:46:25 PM11/25/09
to habari...@googlegroups.com
Great news! Thanks, I'll try it tomorrow.

Balazs
> --
> To post to this group, send email to habari...@googlegroups.com
> To unsubscribe from this group, send email to habari-users...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/habari-users
>



--
http://kobak.org
http://fotolog.hu

Balazs Koren

unread,
Dec 3, 2009, 5:29:46 AM12/3/09
to habari...@googlegroups.com
My log after the upgrade is full of these errors:

PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access
violation: 1064 You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near '} where tag_slug= 'app'' at line 1 in s...

Everything else lokks like working fine.

Balazs

Michael C. Harris

unread,
Dec 3, 2009, 5:55:58 AM12/3/09
to habari...@googlegroups.com
2009/12/3 Balazs Koren <balazs...@gmail.com>:
> My log after the upgrade is full of these errors:
>
> PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access
> violation: 1064 You have an error in your SQL syntax; check the manual
> that corresponds to your MySQL server version for the right syntax to
> use near '} where tag_slug= 'app'' at line 1 in s...
>
> Everything else lokks like working fine.

What plugins are active ?


--
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog
IRC: michaeltwofish #habari

rick c

unread,
Dec 3, 2009, 7:31:34 AM12/3/09
to habari-users
As Michael implied in asking what plugins are active, the most likely
source of the errors is either a plugin or a function in your theme's
theme.php. One of these appears to using direct database ask through
SQL to get the tag you want, and needs to be updated to use the
correct tables. The tags and tag2post tables are no longer used.
Instead, terms and object_terms are used. We'd be happy to help
correct these, or you can look in the trunk version of the metaseo
plugin or the built-in theme, Charcoal's theme.php for examples of
proper usage.

Rick

On Dec 3, 5:29 am, Balazs Koren <balazs.ko...@gmail.com> wrote:
> My log after the upgrade is full of these errors:
>
> PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access
> violation: 1064 You have an error in your SQL syntax; check the manual
> that corresponds to your MySQL server version for the right syntax to
> use near '} where tag_slug= 'app'' at line 1 in s...
>
> Everything else lokks like working fine.
>
> Balazs
>
>
>
> On Wed, Nov 25, 2009 at 10:46 PM, Balazs Koren <balazs.ko...@gmail.com> wrote:
> > Great news! Thanks, I'll try it tomorrow.
>
> > Balazs
>
> >> For more options, visit this group athttp://groups.google.com/group/habari-users

Balazs Koren

unread,
Dec 3, 2009, 5:58:19 PM12/3/09
to habari...@googlegroups.com
Updating the metaseo helped. Thanks.
> For more options, visit this group at http://groups.google.com/group/habari-users

Balazs Koren

unread,
Dec 5, 2009, 4:06:59 PM12/5/09
to habari...@googlegroups.com
Hi,

I get now another error message:

Trying to get property of non-object in system/classes/tags.php:39

I get it even, when using the charchoal theme.

plugin info:

---
PLUGIN INFORMATION
/system/plugins:
Core Dash Modules:
/var/www/kobak.org/www/system/plugins/coredashmodules/coredashmodules.plugin.php
Spam Checker: /var/www/kobak.org/www/system/plugins/spamchecker/spamchecker.plugin.php
Habari Media Silo:
/var/www/kobak.org/www/system/plugins/habarisilo/habarisilo.plugin.php

/user/plugins:
Fresh Comments:
/var/www/kobak.org/www/user/plugins/freshcomments/freshcomments.plugin.php
RN Tag Cloud: /var/www/kobak.org/www/user/plugins/tagcloud/tagcloud.plugin.php
Gravatar: /var/www/kobak.org/www/user/plugins/gravatar/gravatar.plugin.php
RN Monthly Archives:
/var/www/kobak.org/www/user/plugins/archives/archives.plugin.php
GoogleAnalytics:
/var/www/kobak.org/www/user/plugins/googleanalytics/googleanalytics.plugin.php
Sitemaps: /var/www/kobak.org/www/user/plugins/sitemaps/sitemaps.plugin.php
Preapproved: /var/www/kobak.org/www/user/plugins/preapproved/preapproved.plugin.php
Asciify: /var/www/kobak.org/www/user/plugins/asciify/asciify.plugin.php
Autopinger: /var/www/kobak.org/www/user/plugins/autopinger/autopinger.plugin.php
Comment Notifier:
/var/www/kobak.org/www/user/plugins/comment_notifier/comment_notifier.plugin.php
Footnotes: /var/www/kobak.org/www/user/plugins/footnotes/footnotes.plugin.php
Jambo: /var/www/kobak.org/www/user/plugins/jambo/jambo.plugin.php
markUp: /var/www/kobak.org/www/user/plugins/markup/markup.plugin.php
Meta SEO: /var/www/kobak.org/www/user/plugins/metaseo/metaseo.plugin.php
RN Related Posts:
/var/www/kobak.org/www/user/plugins/relatedposts/relatedposts.plugin.php
FlickrFeed: /var/www/kobak.org/www/user/plugins/flickrfeed/flickrfeed.plugin.php
Comment Ident: /var/www/kobak.org/www/user/plugins/comment-ident/comment-ident.plugin.php

/3rdparty/plugins:
None found

/other/plugins:
None found
---

Thanks for the help.

Balazs

Michael C. Harris

unread,
Dec 5, 2009, 5:07:39 PM12/5/09
to habari...@googlegroups.com
2009/12/6 Balazs Koren <balazs...@gmail.com>:
>
> I get now another error message:
>
> Trying to get property of non-object in system/classes/tags.php:39
>
> I get it even, when using the charchoal theme.
>
> /user/plugins:
> RN Tag Cloud: /var/www/kobak.org/www/user/plugins/tagcloud/tagcloud.plugin.php

Are you using the updated version of the tag cloud, released about a week ago ?

http://blog.tinyau.net/archives/2007/08/30/habari-rn-tag-cloud-plugin/

Balazs Koren

unread,
Dec 5, 2009, 7:01:40 PM12/5/09
to habari...@googlegroups.com
Yes, I thought, I updated the tagcloud and the related posts plugins
both. Updated again, I hope it helps.

Balazs

Balazs Koren

unread,
Dec 6, 2009, 4:38:06 AM12/6/09
to habari...@googlegroups.com
Ssadly it does not. I still get the errors. :-(
Reply all
Reply to author
Forward
0 new messages