crudbooster icon indicating copy to clipboard operation
crudbooster copied to clipboard

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

Open rivara opened this issue 4 years ago • 11 comments

Hi , i try to save anything in control pannel and show it the next error Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) (View: C:\laragon\www\crudbooster\vendor\crocodicstudio\crudbooster\src\views\default\table.blade.php) (View: C:\laragon\www\crudbooster\vendor\crocodicstudio\crudbooster\src\views\default\table.blade.php)

rivara avatar Nov 15 '20 11:11 rivara

try laravel 6, CB 5.5 and php 7.3

fherryfherry avatar Nov 17 '20 18:11 fherryfherry

Please tell me how to solve this error, I will fix it in my project as well make a PR so this issue is fixed in next update.

umer2001 avatar Dec 22 '20 07:12 umer2001

try laravel 6, CB 5.5 and php 7.3

everything is checked and installed fresh project but still this issue is not resolved, please help...

aagastya-sid avatar Jan 06 '21 04:01 aagastya-sid

I will check

fherryfherry avatar Jan 06 '21 04:01 fherryfherry

  1. either downgrade php 7.4 to php 7.3 or 7.2
  2. Or just go to crudbooster\vendor\crocodicstudio\crudbooster\src\views\default\table.blade.php change the at line numbers 371 & 385 , the class names

class='filter-value-between form-control {{ (in_array($col["type_data"],["date","datetime","timestamp"]))?"datepicker":(in_array($col["type_data"],["time"]))?"timepicker":"" }}' , it's just short hand under to avoid long if..else condition checking to adding the class to the input field as per data type of the field selected while you are building the crud. but that old syntax of short hand not supported in PHP 7.4 , so change it as per PHP 7.4 wants. More about this at official website : https://www.php.net/manual/en/migration74.deprecated.php

SwapnilAkolkar avatar Jan 22 '21 04:01 SwapnilAkolkar

help im have a error too up to php8.0

Fatal error: Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in ./Booking.php on line 507 There has been a critical error on this website.

there is line 506 to end // have time and know page ? $cancellationText = $cancellationHours<24 ? $cancellationHours . __(" hours", 'salon-booking-system') : $cancellationHours==24? __("1 day", 'salon-booking-system') : round($cancellationHours/24) . __("days", 'salon-booking-system'); $bookingMyAccountUrl = get_permalink($bookingMyAccountPageId); return true; }

function getTips()
{
    $data = $this->getMeta('tips');
    $data = empty($data) ? 0 : (float)$data;

    return $data;
}

}

batboyboy1990 avatar May 20 '21 13:05 batboyboy1990

Has anyone got a Quick solution to this? Am having the same issue.

Eddievin avatar Jun 20 '21 12:06 Eddievin

Have anyone solution of this problem

asim3065 avatar Jun 22 '21 10:06 asim3065

Have anyone solution of this problem

one way! back to free version :((!

batboyboy1990 avatar Jun 22 '21 11:06 batboyboy1990

Hi,

I think you use double ternary if, the solution is here, example:

$RequestIP = ((isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);

rmdhfz avatar Nov 04 '21 06:11 rmdhfz

Symfony \ Component \ ErrorHandler \ Error \ FatalError Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

I can't downgrade my php version. any other solution please?.

vishalss-vareli avatar Sep 12 '22 11:09 vishalss-vareli