Jump to content

Error upgrading/downgrading plan with Virtualmin module of Blesta


Recommended Posts

Posted

Issue is unable to change plan used on Virtualmin, with Virtualmin module through Blesta, with upgrade/downgrade.

Two stage manual change is a workaround (change without module on Blesta and then change directly on Virtualmin)

Steps to reproduce are: Client, Service, Manage, Upgrade/Downgrade, change package/term (with Use module ticked -module is Virtualmin), Save

URL page before error is .../admin/clients/editservice/......

Result is HTTP 500 error

Blesta general error in logs:

general.ERROR: Uncaught Exception TypeError: "array_key_exists(): Argument #2 ($array) must be of type array, stdClass given" at .../blesta/components/modules/virtualmin/virtualmin.php line 867 {"exception":"[object] (TypeError(code: 0): array_key_exists(): Argument #2 ($array) must be of type array, stdClass given at .../blesta/components/modules/virtualmin/virtualmin.php:867)"}

OS is Debian 12, Blesta version is 5.9.3, PHP version is 8.2.7, Blesta Virtualmin module version is 1.8.0

This bug was originally reported in error to the 5.9 beta bugs section.

 

Posted

I fixed the bug reported above myself by editing 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) {

However, although this restores behaviour to same as with php7, a detailed look at the effects showed only the plan name was changed in Virtualmin. This is another bug.

I will post details of this additionally discovered bug after I have tested what may be a fix for it.

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...