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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
genepilot
Forum Members
Forum Members
Posts: 18
Joined: Wed Feb 27, 2008 4:42 pm

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

Post 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 ???
genepilot
Forum Members
Forum Members
Posts: 18
Joined: Wed Feb 27, 2008 4:42 pm

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

Post 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?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

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

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
genepilot
Forum Members
Forum Members
Posts: 18
Joined: Wed Feb 27, 2008 4:42 pm

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

Post 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?
genepilot
Forum Members
Forum Members
Posts: 18
Joined: Wed Feb 27, 2008 4:42 pm

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

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

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

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Developers Discussion”