TrackAnything form doesn't work with php8

Using openemr v6, with and without patch 3. Hosted in xampp 8 (php 8)

I have no problems with the form when openEMR 6 runs under php 7

The form opens, and I can add a track, and items to the track. But when I then try to select the track to fill it in, I get a blank form

Php error:
[28-Nov-2021 23:32:25 Europe/Berlin] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in /Applications/XAMPP/xamppfiles/htdocs/openemr/interface/forms/track_anything/new.php:124
Stack trace:
#0 {main}
thrown in /Applications/XAMPP/xamppfiles/htdocs/openemr/interface/forms/track_anything/new.php on line 124

Looking at the code, I don’t see anything obvious to fix

Also, what do the #echo commands do?


@hanksterr7 try this. goes to: interface/forms/track_anything/new.php

Doubt will put in patch as v6.1 will be out soon.

new.php (10.9 KB)

That worked! Thanks!