Jump to content

Fix for bug in Virtualmin module of Blesta that prevents changed plan limits being applied


Recommended Posts

Posted

This bug applies to current version of Blesta, version 5.9.3.

When using the Upgrade/Downgrade feature for service management that uses the Virtualmin module, a change of Package/Term corresponds to a plan change in Virtualmin, as well as other changes.

With this feature, although a plan is changed, limits of the changed plan are not applied, such as a change of allocated disk space or a change in allowed number of servers.

The name of the parameter that is passed to virtualmin is --plan. It should instead be --apply-plan to also include changed plan limits.

From https://www.virtualmin.com/documentation/developer/cli/modify_domain/

"To change a virtual server's plan and apply quota and other limits from the new plan, use the --apply-plan parameter followed by the plan name or ID. Alternately, you can switch the plan without applying any of it's limits with the --plan flag."

To make this fix, edit line 1108 in file blesta/components/modules/virtualmin/virtualmin.php
from:

      'plan' => $package_to->meta->plan,

to:

   'apply-plan' => $package_to->meta->plan,

In addition, if using php8 with Blesta 5.9.3, it is necessary to also make the following change to fix a TypeError bug

Edit line 867 in file  blesta/components/modules/virtualmin/virtualmin.php

from:

                if (!array_key_exists($key, $service_fields) || $vars[$key] != $service_fields->$key) {

to:

                if (!array_key_exists($key, (array)$service_fields) || $vars[$key] != $service_fields->$key) {

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...