Fatal error: Uncaught Error: array_unique(): Argument #1 ($array) must be of type array, null given

Fatal error : Uncaught Error: array_unique(): Argument #1 ($array) must be of type array, null given

Using Sage 9.0.10 and recently upgraded to php8.0. After the update when I go to list all my post within Admin I’m met with the error above. The stack trace seems to land on the functions.php file on line 56

array_map(function ($file) use ($sage_error) {
$file = “…/app/{$file}.php”;
if (!locate_template($file, true, true)) {
$sage_error(sprintf(__(‘Error locating %s for inclusion.’, ‘sage’), $file), ‘File not found’);
}
}, [‘helpers’, ‘setup’, ‘filters’, ‘admin’]);

If I comment this out the fatal error goes away I can see all my posts again. Any idea what the issue is or if there is an update for doing with php8 for Sage9?

My guess is that the error is triggered by something in one of the files that gets included by the code you commented out to make the error go away. Try removing each of the items in the array and if the error goes away, dive into the removed file and see if there is anything trying to hook into the posts table.