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

 

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...