Submitted by pcfreak30 on Tue, 08/21/2012 - 00:48
I am writing a virtualmin module and I noticed that if you create a hash element on feature_setup of the VM plugin it gets stored into the domain file via save_domain.
But if you delete the element or set it to undef the conf/data line does not get deleted. This could potentially cause issues.
Status:
Active
Comments
Submitted by JamieCameron on Tue, 08/21/2012 - 01:26 Comment #1
Which function are you deleting the hash element in?
Submitted by pcfreak30 on Tue, 08/21/2012 - 21:25 Comment #2
Basically I created a test plugin.
Ex
[code]
sub feature_setup
{
$_[0]->{"abc123"} = 1;
}
sub feature_disable
{
delete $_[0]->{"abc123"};
}
[/code]
since the hash element doesn't exist it shouln't be in the new file that gets written with the write_file/savedomain based on backtracking subroutine calls. But I grep it on shell its still there.
Submitted by JamieCameron on Tue, 08/21/2012 - 23:27 Comment #3
Yes,
abc123
should be removed from the domain hash.Are you sure that your plugin's
feature_disable
function is actually being called?Submitted by pcfreak30 on Wed, 08/22/2012 - 00:00 Comment #4
Yes I am as I used Data::Dumper to dump the hash before and after.
Submitted by JamieCameron on Wed, 08/22/2012 - 11:11 Comment #5
Are you disabling the domain via the web UI, or using the
disable-domain
API command?Submitted by pcfreak30 on Wed, 08/22/2012 - 14:12 Comment #6
I am not disabling the domain. I am disabling the feature that the plugin provides.
Submitted by JamieCameron on Wed, 08/22/2012 - 15:25 Comment #7
In that case, it isn't the
feature_disable
function that gets called.Rather, the
feature_delete
function is called when you go to Edit Virtual Server, un-check the plugin's feature, and click Save.Submitted by pcfreak30 on Wed, 08/22/2012 - 17:25 Comment #8
Woops I think I named the wrong function in my OP. Sorry that is correct then but same issue still stands.
Submitted by pcfreak30 on Thu, 09/20/2012 - 19:41 Comment #9
Any updates on this bug?
Submitted by JamieCameron on Thu, 09/20/2012 - 20:19 Comment #10
Any chance we could see your plugin code? You can email it to me at jcameron@virtualmin.com