Page 1 of 1

freetag parse error on installation

Posted: Wed Nov 23, 2005 5:33 am
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?

Posted: Wed Nov 23, 2005 7:08 am
by MySchizoBuddy
yeah i got that error too

Posted: Wed Nov 23, 2005 12:50 pm
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

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

Posted: Wed Nov 23, 2005 4:24 pm
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

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

Posted: Wed Nov 23, 2005 5:28 pm
by garvinhicking
Ultravox, which Database type and version are you using?

Regards,
Garvin

DB Version

Posted: Wed Nov 23, 2005 6:41 pm
by ultravox
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)

Re: DB Version

Posted: Wed Nov 23, 2005 8:46 pm
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

That works

Posted: Wed Nov 23, 2005 8:52 pm
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!

Re: That works

Posted: Wed Nov 23, 2005 9:14 pm
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

Thank you!

Posted: Wed Nov 23, 2005 9:53 pm
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!