0

I am just moving our app onto a new server that has PHP 8.0.30 as opposed to PHP 7.4.33 on the current server and I am getting an error from Kartik Grids.  The error is 

Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

the error is reported to be in vendor/kartik-v/yii2-grid/src/ColumnTrait.php line 145

I’ve upgraded kartick-v/yii2-grid to v3.5.3 but still coming up with the same error

line 145 is this:

$curr = is_array($this->format) && isset($this->format[1]) ? $this->format[1] :

and I don’t really know how to proceed now. Can you help please

Problem with Kartik grids
Kartik V Changed status to publish June 27, 2024

Hi, well after some fiddling about I’ve resolved the error, if I change the line to

$curr = is_array($this->format) && isset($this->format[1]) ? ($this->format[1]) : ((isset($formatter->currencyCode)) ? $formatter->currencyCode . ‘ ‘ : ”);

from
$curr = is_array($this->format) && isset($this->format[1]) ? $this->format[1] : isset($formatter->currencyCode) ? $formatter->currencyCode . ‘ ‘ : ”;

its now working