1
Daigoro
Are onInstall and onUninstall working?
  • 2004/3/6 1:05

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


Hi,

I'm trying to get onInstall and onUninstall in module_version.php working. I'm testing with 2.0.6.

I've added the following lines:
$modVersion['onInstall'] = 'installfunctions.php';
$modVersion['onUninstall'] = 'installfunctions.php';


Made a file in my modules root directory called installfunctions.php, which contains these functions:
function xoops_module_install_skeleton(&$module)
function 
xoops_module_uninstall_skeleton(&$module)
(I also tried with $module, instead of &$module, to no awail.)

However, my functions are never executed.

I've tried to trace the problem, and find that in /modules/system/admin/modulesadmin/modulesadmin.php both of the following lines apparently fails
$install_script $module->getInfo('onInstall');

$install_script $module->getInfo('onUninstall');

.. since $install_script becomes an empty sting.

Is it me thats doing something wrong?

Any help is appriciated!

Best regards,
--
Daigoro

2
Mithrandir
Re: Are onInstall and onUninstall working?

$modversion - not $modVersion

3
Daigoro
Re: Are onInstall and onUninstall working?
  • 2004/3/6 11:06

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


Woops. Stupid small mistake! Thanks for pointing out the obvious!

Now both scripts are executed nicely.
I have one small wierd thing, though.

When I install the module, I get no message, despite the function beeing executed. I had expected to see one of the following two messages:

Failed to execute xoops_module_install_skeleton

xoops_module_install_skeleton executed successfully.

However, when I uninstall the module, I get (as expected) a small message like this:
xoops_module_uninstall_skeleton executed successfully.

Any idears what might be the problem?

Regards,
Daigoro

4
Mithrandir
Re: Are onInstall and onUninstall working?

Hmmm... are you absolutely sure that the function is executed? There's an if-else clause so either you should get the "executed successfully" or the "Failed to execute" message.

5
Daigoro
Re: Are onInstall and onUninstall working?
  • 2004/3/6 18:43

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


Mithrandir,

Yes, I'm absolutly sure. To test, I tried to create a directory in the install script, and remove the directoty in the uninstall script. And this happens exactly like I expect it to.

I did notice the if-else, thats why I mentioned I expected it to print one of two messages.

Regards,

6
Mithrandir
Re: Are onInstall and onUninstall working?

Try to look at this bug report

Seems to explain the problem nicely

7
skalpa
Re: Are onInstall and onUninstall working?
  • 2004/3/15 17:52

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16


Quote:
When I install the module, I get no message, despite the function beeing executed. I had expected to see one of the following two messages:


Someone pointed this out 2 days ago (looks like you're not the only one to make stupid small mistakes ).

I've fixed the faulty file, this will be in 2.0.7

skalpa.>

8
Mithrandir
Re: Are onInstall and onUninstall working?

Erhm.. Skalpa
Daigoro's post is a week old. I just wanted to make sure that he read the linked forum post in case he had this on notification, but had overlooked the other one.

GJ on 2.0.7 - now, how about the fixing of the group permissions form as reported on sourceforge *nag* *nag*

Login

Who's Online

362 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 362


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits