Import History page throws fatal error once any import has been logged (v30.0.02, still in main)

Hi @sandra and @Ali

I came across a small bug in System Admin > Import From File > Import History. As soon as there’s at least one import in gibbonLog, the page shows the generic “Oh no! Something has gone wrong” error.

The cause is in modules/System Admin/import_history.php. The array_map closure calls $logGateway->getLogData(), but $logGateway isn’t included in the closure’s use list, so it’s undefined inside the function:

$logsByType = array_map(function ($log) use (&$importTypeList) {

$log\['data'\] = $logGateway->getLogData($log\['serialisedArray'\] ?? '');

The fix is a one-line change:

$logsByType = array_map(function ($log) use (&$importTypeList, $logGateway) {

I’ve patched it locally on a v30.0.02 site and the page loads fine now. It’s still present in main as of this week. Would one of you be able to pick it up in a PR?

Thanks,
Tieku

Hi Tieku, thanks for the heads up, I’ve applied a fix here and it will be part of v30.0.03, which will be released in the coming week.