Karma Logging: Column missing?

Creating and modifying plugins.
Post Reply
commanderx
Regular
Posts: 59
Joined: Mon Apr 18, 2005 8:18 am
Contact:

Karma Logging: Column missing?

Post by commanderx » Wed Jun 29, 2005 12:19 pm

After voting for an article, i got the following Mail from my webserver:

INSERT INTO serendipity_karmalog
(entryid, points, ip, user_agent, votetime)
VALUES (391, 1, '123.123.123.123', 'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.8) Gecko/20050511 Firefox/1.0.4', 1120039749)<br /><pre>INSERT INTO serendipity_karmalog
(entryid, points, ip, user_agent, votetime)
VALUES (391, 1, '123.123.123.123', 'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.8) Gecko/20050511 Firefox/1.0.4', 1120039749)</pre> / Unknown column 'votetime' in 'field list'<br />

I had a look into the table and...surprise...there was no votetime column.
I added the column by hand...maybe its a bug in the plugin?

Plugin Version is 1.01

User avatar
winkiller
Regular
Posts: 77
Joined: Tue May 17, 2005 7:52 pm
Location: Munich, Germany
Contact:

Post by winkiller » Wed Jun 29, 2005 1:46 pm

It could be that version 1.01 is a special case of 1.0 and is not handled, hmm

Code: Select all

if ($version == '1.1') {
            $q   = "ALTER TABLE {$serendipity['dbPrefix']}karma ADD visits INT(11) default 0";
            $sql = serendipity_db_schema_import($q);
            $this->set_config('version', PLUGIN_KARMA_VERSION);
        } elseif ($version == '1.0') {
            $q   = "ALTER TABLE {$serendipity['dbPrefix']}karma ADD visits INT(11) default 0";
            $sql = serendipity_db_schema_import($q);

            $q   = "CREATE TABLE {$serendipity['dbPrefix']}karmalog (
                        entryid int(11) default null,
                        points int(4) default null,
                        ip varchar(15),
                        user_agent varchar(255),
                        votetime int(11) default null
                    )";

commanderx
Regular
Posts: 59
Joined: Mon Apr 18, 2005 8:18 am
Contact:

Post by commanderx » Wed Jun 29, 2005 1:58 pm

Hm...i installed it with Spartacus.
CVS Version comes with 1.4

Post Reply