Skip to main content
Topic: Hooks not removed when package uninstalled (Read 2503 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Hooks not removed when package uninstalled

Testing with spuds hideusernames packages (and my own package) I noticed that after uninstalling the package the integrate_xxx hook variables are still set in the settings table of the database.

Re: Hooks not removed when package uninstalled

Reply #1

 emanuele feels guilty
Bugs creator.
Features destroyer.
Template killer.

Re: Hooks not removed when package uninstalled

Reply #2

Which one is it the package?

I did a very quick test putting:
Code: [Select]
<?php
require_once('SSI.php');

add_integration_function('testing', 'test_func', 'BOARDDIR/test.php');
remove_integration_function('testing', 'test_func', 'BOARDDIR/test.php');
and few variants in a file and running it, but hooks are properly removed.
Bugs creator.
Features destroyer.
Template killer.

Re: Hooks not removed when package uninstalled

Reply #3

I tested with spuds hide user names package.  You can find a copy attached in the thread about errors installing a package.

Re: Hooks not removed when package uninstalled

Reply #4

I see the problem.  I believe you have already fixed it just in a later version of the trunk than I have.

In remove_integration_hook

if (strpos($funcfile, '|') !== false)  should be   if (strpos($filefunc, '|') !== false)

Not sure if you care about this, but if the last function for a particular hook is removed the database entry still exists just with an empty value.


Re: Hooks not removed when package uninstalled

Reply #5

Oh okay, that one!

Quote from: scripple – Not sure if you care about this, but if the last function for a particular hook is removed the database entry still exists just with an empty value.
Is annoying, isn't it?
Will have a look.
Bugs creator.
Features destroyer.
Template killer.

 

Re: Hooks not removed when package uninstalled

Reply #6

In the meantime I added some tests for adding/removing hooks:
https://github.com/emanuele45/Dialogo/commit/eebb4f83cc6a379c0c5e3f3b51bba9420110fcba

And removed also empty hooks:
https://github.com/emanuele45/Dialogo/commit/4daef7d0185f283fccf87ebf081762e1d16f7070
Last Edit: March 15, 2014, 09:47:21 am by emanuele
Bugs creator.
Features destroyer.
Template killer.