Jump to content

Error upgrading/downgrading plan with Virtualmin module of Blesta

John Heenan

Recommended Posts

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.


Link to comment
Share on other sites

I fixed the bug reported above myself by editing line 867 in file  blesta/components/modules/virtualmin/virtualmin.php


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


                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.


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.

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.

  • Create New...