Saving Domain Hash Data

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.



Which function are you deleting the hash element in?

Basically I created a test plugin.


sub feature_setup
$_[0]->{"abc123"} = 1;

sub feature_disable
delete $_[0]->{"abc123"};

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.

Yes, abc123 should be removed from the domain hash.

Are you sure that your plugin's feature_disable function is actually being called?

Yes I am as I used Data::Dumper to dump the hash before and after.

Are you disabling the domain via the web UI, or using the disable-domain API command?

I am not disabling the domain. I am disabling the feature that the plugin provides.

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.

Woops I think I named the wrong function in my OP. Sorry that is correct then but same issue still stands.

Any updates on this bug?