Jump to content

Fix for error level bug in Virtualmin module due to removed behaviour in PHP 8.0.0


Recommended Posts

Posted

Blesta: 5.10.0.b1
PHP: 8.2.18
OS: Debian 12.5

Line 871 in Virtualmin module file virtualmin.php, in editService function, now causes an error instead of a deprecation message with php 8.2.17, with array_key_exists:
if (!array_key_exists($key, $service_fields) || $vars[$key] != $service_fields->$key) {

$service_fields is a stdClass, not an array.

Reference for array_key_exists is at https://www.php.net/manual/en/function.array-key-exists.php

One line fix is :
if (!property_exists($service_fields, $key) || $vars[$key] != $service_fields->$key) {

 

Posted

This bug has alredy been fixed in Blesta 5.10.0-b2 beta, which was released nine days ago.

I missed the release because b2 beta was not announced in the Blesta software feed reader.

The fix used is the same as a shorter fix included in a post by me below.

The fix I included for the upgrade/downgrade bug is also included in b2 beta.

Thanks Blesta

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...