Uncaught TypeError: count()
Posted: Thu May 11, 2023 9:30 pm
Script: admin_ticket.php
Hesk version: 3.4.3
Hey!
This error happens if you have attachments turned Off and you want to post a note and also you are on >=PHP8.0 ("count() will now throw TypeError on invalid countable types passed to the value parameter.").
Line 378:
My quick-fix solution:
Thanks 
Hesk version: 3.4.3
Hey!

Code: Select all
PHP Warning: Undefined variable $attachments in (...) /admin/admin_ticket.php on line 378
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in (...) /admin/admin_ticket.php:378
Line 378:
Code: Select all
if ( count($attachments) || strlen($msg) || count($hesk_error_buffer) )
Code: Select all
if ( (!empty($attachments) && count($attachments)) || strlen($msg) || count($hesk_error_buffer) )
