I'm in the middle of building an event calendar module based on MyCalendar but I'm getting some weird problem where the install.php script runs, the database tables are properly created, but the module doesn't appear in the "Uninstall Modules" list. I looked in my addons table and noticed my module wasn't there. The correct module folder is created in WB_ROOT/modules/ and WB reports "Success" when installing the module ZIP.
I've been able to track the problem down to around the fourth database query in my install.php script by incrementally uncommenting lines in my code:
<?php
require_once('info.php');
$database->query("DROP TABLE IF EXISTS ".$TabBase);
$database->query("DROP TABLE IF EXISTS ".$TabEvents);
//ok by here
$database->query("CREATE TABLE $TabBase (
section_id INT NOT NULL,
page_id INT NOT NULL,
settings TEXT,
PRIMARY KEY (section_id))"
);
if( $database->is_error() )
die($database->get_error());
// ok by here
// silent failure somewhere below here
$database->query("CREATE TABLE $TabEvents (
id INT NOT NULL AUTO_INCREMENT,
section_id INT NOT NULL,
page_id INT NOT NULL,
owner INT NOT NULL,
date_start DATE NOT NULL,
time_start TIME default NULL,
date_end DATE default NULL,
time_end TIME default NULL,
acttype TINYINT(4) NOT NULL,
name VARCHAR(255) NOT NULL,
description TEXT default NULL,
place TEXT default NULL,
contact_name VARCHAR(255) NOT NULL,
contact_email VARCHAR(255) NOT NULL,
contact_phone VARCHAR(255) default NULL,
public_stat TINYINT(4) NOT NULL default '0',
news_section_id INT NOT NULL default '0',
news_page_id INT NOT NULL default '0',
PRIMARY KEY (id))"
);
if( $database->is_error() )
die($database->get_error());
?>
I've run the SQL directly in phpMyAdmin with no errors and the die statements never execute.
Could anyone put a second pair of eyes on this? I'm at a loss as to where the problem is... I've attached the a minimized skeleton of the full module which exhibits this problem if you need more than just the install.php script.
I'm using WB 2.8, not 2.8.1. Thanks