WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Calendar] Plugin Activation SQL broken – manual fix here

[Plugin: Calendar] Plugin Activation SQL broken – manual fix here

  • Wil

    @gravitationalfx

    I’ve got WP 3.0 and downloaded your v1.2.3 calendar.

    Wasn’t working so I planted a few debug statements in the code.

    Looks like around line 391 when you’re detecting if you should create the new tables, the SQL for creating the wp_calendar table is wrong.

    The tabele wasn’t being created in my install so I fired up MySQL Admin and inserted the SQL manually.

    CREATE TABLE wp_calendar ( event_id INT(11) NOT NULL AUTO_INCREMENT ,
    event_begin DATE NOT NULL ,
    event_end DATE NOT NULL ,
    event_title VARCHAR(30) NOT NULL ,
    event_desc TEXT NOT NULL ,
    event_time TIME ,
    event_recur CHAR(1) ,
    event_repeats INT(3) ,
    event_author BIGINT(20) UNSIGNED ,
    event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT 1 ,
    event_link TEXT DEFAULT ” ,
    PRIMARY KEY (event_id))
    The Query Browser said you can’t have a default value for the blob/text field event_link.

    So the table is never created.

    This is the problem people are having when installing the plugin.

    They will get the error message saying that the event can’t be created.. database error etc..

    Remove the default option on event_link and the plugin works fine.

    I manually rand this altered SQL code and everything is hunky-dory.

    CREATE TABLE wp_calendar ( event_id INT(11) NOT NULL AUTO_INCREMENT ,
    event_begin DATE NOT NULL ,
    event_end DATE NOT NULL ,
    event_title VARCHAR(30) NOT NULL ,
    event_desc TEXT NOT NULL ,
    event_time TIME ,
    event_recur CHAR(1) ,
    event_repeats INT(3) ,
    event_author BIGINT(20) UNSIGNED ,
    event_category BIGINT(20) UNSIGNED NOT NULL DEFAULT 1 ,
    event_link TEXT ,
    PRIMARY KEY (event_id))

    You might want to check the results for yourself and bundle this up to the SVN in a new version.

    For those having this problem and able to get to the DB, you can run the query manually on your wordpress DB and the plugin will work fine.

    Always backup your DB first before hacking it.

    Nice plugin BTW.

    Cheerz,
    Wil.

    http://wordpress.org/extend/plugins/calendar/

  • The topic ‘[Plugin: Calendar] Plugin Activation SQL broken – manual fix here’ is closed to new replies.