fix: address PR review findings — error handling and data integrity

- Add missing language field to batch-generated records
- Wrap batch insert in try-catch to handle duplicate key races
- Add logging to all empty catch blocks (script.php, MokoOG license check)
- Guard loadShopProduct() with try-catch for missing MokoSuiteShop tables
- Guard reviews query in JsonLdBuilder for missing #__mokoshop_reviews
This commit is contained in:
Jonathan Miller
2026-06-21 16:26:13 -05:00
parent 38af92b876
commit 46e30c950b
4 changed files with 63 additions and 41 deletions
+9 -3
View File
@@ -82,7 +82,9 @@ class Pkg_MokoOGInstallerScript
$key = $db->loadResult();
if (!empty($key)) { $this->savedDownloadKey = $key; }
}
catch (\Throwable $e) {}
catch (\Throwable $e) {
\Joomla\CMS\Log\Log::add('MokoOG saveDownloadKey: ' . $e->getMessage(), \Joomla\CMS\Log\Log::WARNING, 'mokoog');
}
}
private function restoreDownloadKey(): void
@@ -112,7 +114,9 @@ class Pkg_MokoOGInstallerScript
)->execute();
}
}
catch (\Throwable $e) {}
catch (\Throwable $e) {
\Joomla\CMS\Log\Log::add('MokoOG restoreDownloadKey: ' . $e->getMessage(), \Joomla\CMS\Log\Log::WARNING, 'mokoog');
}
}
private function warnMissingLicenseKey(): void
@@ -147,6 +151,8 @@ class Pkg_MokoOGInstallerScript
'warning'
);
}
catch (\Throwable $e) {}
catch (\Throwable $e) {
\Joomla\CMS\Log\Log::add('MokoOG warnMissingLicenseKey: ' . $e->getMessage(), \Joomla\CMS\Log\Log::WARNING, 'mokoog');
}
}
}