Jump to content

Custom Module Error


ukgaz

Recommended Posts

Hi Everyone,

 

Been playing around with some custom module work lately and getting a bit stumped on a strange error that is emerging and thought I'd ask if anyone else has seen this one occur

 

Fatal error: Cannot redeclare template_ConfigOptions() (previously declared in FILELOCATION: in FILELOCATION on line 16

 

Any suggestions on what to try out, I first set it to the following where I guess is the issue :

 

function mydb_ConfigOptions() {

# Should return an array of the module options for each product - maximum of 24

   $configarray = array(
 "Package Name" => array( "Type" => "text", "Size" => "25", ),
);
return $configarray;
}

 

and then tried the default and getting the exact same result.

Link to comment
Share on other sites

  • 3 weeks later...

I have this same problem:

 

Fatal error: Cannot redeclare cabinets_admincustombuttonarray() (previously declared in /home/forked/Sites/portal/modules/servers/cabinets/cabinets.php:6) in /home/forked/Sites/portal/modules/servers/cabinets/cabinets.php on line 11

Link to comment
Share on other sites

It was giving the same error with every function. I found a workaround which is:

 

Place the php code in a separate file (example: code.php) and then in the module use this code:

 

<? php
include_once('code.php');
?>

 

Otherwise there seems to be a bug in whmcs that is loading the module twice. I'm using WHMCS 4.5.2 (an old version).

Link to comment
Share on other sites

I managed to figure this one out, you must have MODULENAME_ at the start of every command, simple schoolboy error!

 

Just trying to get SQL to create a user now in an action button but not having much luck :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated