Can't get very basic custom plugin to work

1 post / 0 new
#1 Thu, 03/24/2016 - 10:51
banaan

Can't get very basic custom plugin to work

This is driving me crazy for hours now.

Below is my extremely basic plugin (virtual_feature.pl). The plugin is displayed in the plugin overview of virtualmin and I can enable it. But no matter what I do the labels that are suppose to show using "feature_label" do not show. Furthermore, "feature_setup" is never executed.

Perhaps cache? Already tried the "Refresh modules" button, and the "clear cache" button. The file "/etc/webmin/module.infos.cache" never seems to be present, so can't delete that one as described here https://www.virtualmin.com/documentation/developer/plugins.

require 'virtualmin-require-lib.pl';

sub feature_name
{
  return 'Test plugin';
}

# feature_losing(&domain)
# Returns a description of what will be deleted when this feature is removed
sub feature_losing
{
  return 'Plugin will be disabled, and its configuration deleted';
}

# feature_disname(&domain)
# Returns a description of what will be turned off when this feature is disabled
sub feature_disname
{
  return 'test';
}

# feature_label(in-edit-form)
# Returns the name of this feature, as displayed on the domain creation and
# editing form
sub feature_label
{
  return 'Enable test?';
}

sub feature_setup
{
  &$virtual_server::first_print('test');
}

1;