Jump to content

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


John Heenan

Recommended Posts

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) {

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...