freetag parse error on installation

Creating and modifying plugins.
Post Reply
ultravox
Regular
Posts: 9
Joined: Fri Jul 15, 2005 8:17 pm
Location: Minneapolis, MN
Contact:

freetag parse error on installation

Post by ultravox »

After I install the freetag event plugin I get the following error message at the top of my list of plugins:

Parse error: parse error, expecting `'}'' in /home/timf/www/serendipity/plugins/serendipity_event_freetag/serendipity_plugin_freetag.php on line 84

I also get a plugin in my sidebar plugins area that looks like this:

Error!
Error: serendipity_plugin_freetag:386b1f74ff92890b0adf4575595f3121

I just upgraded to Serendipity version 0.9 and it still does the same thing.

The freetag plugin says it's version 2.30

Help?
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

yeah i got that error too
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Damn, it was indeed a parse error in that plugin file. I just fixed it.

You need to go to line 84 and modify this to:

Code: Select all

$query = "SELECT tag, count(tag) as total FROM {$serendipity['dbPrefix']}entrytags GROUP BY tag HAVING total >= " . $this->get_config('treshold_tag_count') . " ORDER BY tag LIMIT " . $this->get_config('max_tags');
That means you cannot pass the $this->config calls in "{" and "}".

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ultravox
Regular
Posts: 9
Joined: Fri Jul 15, 2005 8:17 pm
Location: Minneapolis, MN
Contact:

Now I get an error when I try and display tagged items

Post by ultravox »

When I configure the sidebar plugin and then click on a tag in the sidebar, I get this error:

Query failed:

SELECT


e.id,
e.title,
e.timestamp,
e.comments,
e.exflag,
e.authorid,
e.trackbacks,
e.isdraft,
e.allow_comments,
e.last_modified,

a.realname AS author,
a.email

, e.body, e.extended

FROM
serendipity_entries AS e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid
JOIN serendipity_entrytags AS entrytags ON (e.id = entrytags.entryid) LEFT JOIN serendipity_authorgroups AS acl_a
ON acl_a.authorid = 1
LEFT JOIN serendipity_access AS acl_acc
ON ( acl_acc.artifact_mode = 'read'
AND acl_acc.artifact_type = 'category'
AND acl_acc.artifact_id = c.categoryid
)
WHERE isdraft = 'false' AND e.timestamp <= '1132759075' AND entrytags.tag = 'DRM' AND (
c.categoryid IS NULL
OR ( acl_acc.groupid = acl_a.groupid OR acl_acc.groupid = 0)
OR ( acl_acc.artifact_id IS NULL

)
)
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 10

/ You have an error in your SQL syntax near 'ON (e.id = entrytags.entryid) LEFT JOIN serendipity_authorgroups AS acl_a ' at line 28
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Now I get an error when I try and display tagged items

Post by garvinhicking »

Ultravox, which Database type and version are you using?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ultravox
Regular
Posts: 9
Joined: Fri Jul 15, 2005 8:17 pm
Location: Minneapolis, MN
Contact:

DB Version

Post by ultravox »

mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: DB Version

Post by garvinhicking »

Oh, that is a really old mysql version you have there. It seems to have troubles with joins.

Can you please use a tool like phpMyAdmin or the commandline mysql to execute this query:

Code: Select all

SELECT


e.id,
e.title,
e.timestamp,
e.comments,
e.exflag,
e.authorid,
e.trackbacks,
e.isdraft,
e.allow_comments,
e.last_modified,

a.realname AS author,
a.email

, e.body, e.extended

FROM
serendipity_entries AS e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid
INNER JOIN serendipity_entrytags AS entrytags ON (e.id = entrytags.entryid) LEFT JOIN serendipity_authorgroups AS acl_a
ON acl_a.authorid = 1
LEFT JOIN serendipity_access AS acl_acc
ON ( acl_acc.artifact_mode = 'read'
AND acl_acc.artifact_type = 'category'
AND acl_acc.artifact_id = c.categoryid
)
WHERE isdraft = 'false' AND e.timestamp <= '1132759075' AND entrytags.tag = 'DRM' AND (
c.categoryid IS NULL
OR ( acl_acc.groupid = acl_a.groupid OR acl_acc.groupid = 0)
OR ( acl_acc.artifact_id IS NULL

)
)
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 10
And see if that generates an error as well?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ultravox
Regular
Posts: 9
Joined: Fri Jul 15, 2005 8:17 pm
Location: Minneapolis, MN
Contact:

That works

Post by ultravox »

That worked. Maybe I need to look into upgrading mysql.

But not today. :?

What would need to change in the code for this to work? And would it be forwards compatible?

Thanks for your work on this!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: That works

Post by garvinhicking »

I've just committed a new version of the plugin, by just replacing the "JOIN" (only the joins, not the LEFT (OUTER) JOINS!) with a "INNER JOIN". That is compatibly to mysql 3.23

But Updating to Mysql 4 is reocmmended, it's noticably faster.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ultravox
Regular
Posts: 9
Joined: Fri Jul 15, 2005 8:17 pm
Location: Minneapolis, MN
Contact:

Thank you!

Post by ultravox »

I made your change to the JOIN and it's working well.

I suppose I ought to upgrade to MySQL 4 at some point. We'll see.

Thanks again!
Post Reply