Support Forum
Hi all
I've just updated to MetaBox-AIO from v1.24.2 to v1.26.2 , using php8.2, and I get the following error when rendering views
Deprecated: Use of "static" in callables is deprecated in /var/www/html/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/src/Fields/BaseRenderer.php on line 11
The view that is rendering is like this one. It fails rendering {{ segmento.nombre_visible }}
<div class="ytk-product-gallery">
{% set relationship = attribute( relationships, 'pilar-del-segmento' ) %}
{% for segmento in relationship.from %}
<div class="ypg-segmento">
<h2>{{ segmento.nombre_visible }}</h2>
The affected Metabox code is this one
<?php
namespace MBViews\Fields;
use RWMB_Field;
class BaseRenderer {
public static $field;
public static function parse( $value, $field ) {
self::$field = $field;
return $field['clone'] ? array_map( 'static::get_clone_value', (array) $value ) : static::get_clone_value( $value );
}
public static function get_clone_value( $clone ) {
return self::$field['multiple'] ? array_map( 'static::get_single_value', (array) $clone ) : static::get_single_value( $clone );
}
public static function get_single_value( $value ) {
return RWMB_Field::call( 'format_single_value', self::$field, $value, [], null );
}
}
This is breaking all the sites based on MetaBox Views.
Thanks!
Hi all
I've continued investigating this issue and found out that both versions of Metabox are breaking, the problem lies in the PHP version.
It works ok with PHP version 8.2.17, but if upgraded to version 8.2.18, this deprecation error hits and breaks the sites. This PHP version has been pushed 12 days ago on the DockerHub WordPress image 6.5.2-php8.2.
What is the suggested solution?
Thanks!
Hello Juan,
I believe many plugins and themes are not compatible with every new PHP version. It will take time to update the functions in the source code to be adapted with PHP 8.2.18. For now, I suggest using the lower PHP version (8.2.17 as you said or 8.2.0) to solve the issue.
Hi all
Sorry I was previously mistaken, it's not a PHP version problem, but somehow in the last MetaBox-AIO package its showing all errors on the site, which previously hadn't. And then it breaks a lot of things.
I could solve it by setting in wp-config.php the following setting
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
Please check that I had to set WP_DEBUG_DISPLAY because it somehow was set even when WP_DEBUG was set to false.
Thanks!