Page 1 of 1

How do I see what's going wrong on module install?

Posted: Wed May 21, 2008 8:51 pm
by genepilot
I'm doing a module install using the same table creation code that I sued on a different module on a different site.

Something is going wrong but I don't know how to get feedback on what is failing during the module install!!!

How do I do this?

Thanks,
Brett ???

Re: How do I see what's going wrong on module install?

Posted: Wed May 21, 2008 9:26 pm
by genepilot
This is one of my own making from the skeleton.

It turns out that non of my method.install.php code is getting executed! ????

Anybody know any reason why this would happen?

Re: How do I see what's going wrong on module install?

Posted: Wed May 21, 2008 9:30 pm
by calguy1000
The only reason method.install.php would not get executed is if you have an Install() method in your xxxx.module.php
file.

In mordern modules you should not have the following methods in your xxxxx.module.php file
Install()
Upgrade()
Uninstall()

if you take these methods out, the method..php files will be executed.

Re: How do I see what's going wrong on module install?

Posted: Wed May 21, 2008 9:36 pm
by genepilot
Thos methods are commented out in the xxx.module.php file.

Here is how I know it's not getting executed:  in my method.install.php file I have the following lines before any code is getting executed:


global $gInstallErrors;
$gInstallErrors = "Starting Install\n";

Then in my xxx.module.php file


function InstallPostMessage()
{
global $gInstallErrors;
return "Result:".$gInstallErrors;
}

The output is just displaying: 'Result:'

Any ideas?

Re: How do I see what's going wrong on module install?

Posted: Wed May 21, 2008 9:43 pm
by genepilot
Okay, it finally submitted properly (created the tables and populated one).

The error that I made was that in:
function GetName()
{
return 'submitMgr';
}
I didn't set the proper name.

But, now I'm curious why my global variable was not properly set after it got run.

Re: How do I see what's going wrong on module install?

Posted: Wed May 21, 2008 10:22 pm
by calguy1000
simple rule.

don't use globals.

There are methods for showing and displaying errors already in the module (though they aren't well documented).

I use die(__FILE__) statements everywhere when I need to test that the program is actually reaching my code.