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:
+9
-3
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user