Bug in Install Module API?
Posted: Sat Aug 12, 2006 7:54 pm
I have difficulties understanding how to use the Install() function in the Module Class.
If install fails the return message isn't displayed, but --Add Me - errorinstallfailed -- instead. I've tried to add $lang['errorinstallfailed'] in the language file and a errorinstallfailed() function, but no go.
So I wrote something like this:API Docs wrote:Install (line 844)
Function that will get called as module is installed. This function should do any initialization functions including creating database tables. It should return a string message if there is a failure. Returning nothing (FALSE) will allow the install procedure to proceed.
void Install ()
Code: Select all
function Install() {
if (HaveAllRequirement() == true) {
... //proceed with install
} else {
return "This module cannot be installed because of X";
}
}