Welcome, Guest. Please login or register.
Did you miss your activation email?
February 11, 2012, 08:55:33 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149584 Posts in 21094 Topics by 7536 Members
Latest Member: SpokaneDude
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Custom module not appearing in modules list  (Read 384 times)
rcdscc

Offline Offline

Posts: 3


« on: July 06, 2010, 09:00:22 PM »

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:
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
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2814



WWW
« Reply #1 on: July 06, 2010, 09:56:22 PM »

Must have to do with your info.php

WB scans directorys inside modules for info.php from with it extracts info about the module

must be the info.php


Have fun,
John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
oeh

Offline Offline

Posts: 190



« Reply #2 on: July 06, 2010, 10:22:28 PM »

Hi.

The info.php, well, have a sneak peek at some other info.php.
Maybe Event Calendar  rolleyes

You should consider giving your Event Calendar some other name, so that it does not come in conflict with
the existing module.
Also you could use Modul Informations to manage your info.php file
Logged

Good bye ;-{(
oeh ;-}>
rcdscc

Offline Offline

Posts: 3


« Reply #3 on: July 13, 2010, 02:29:55 AM »

Well this module is for internal use only, so the module name would certainly have to be changed once I sanitize and release it. I kept the "Event Calendar" name for now to keep the WB backend simple and clean.

I did manage to figure out what the issue was. Apparently the require_once('info.php'); line in install.php was making the WB installer routine choke before it added the module to the modules table. I still have no clue why but the variables I needed in the info.php file are still accessible due to the global keyword I put in my info.php file.

Removing the require_once from install.php seems to have cleared up the issue in the test-case I posted.

Thanks,

-rb
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!