mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Error tests, FK violations fix
- ErrorHandler tests: 77 assertions covering FK extraction, normalization, dedup, edge cases. Fix FK table map for child tables. - Fix FK violation: (int)null → 0 in createThesis for orientation/ap/finality/license FK columns. Add FK value logging to updateThesis. - Add CURRENT_ISSUES.md with summary of FK violation, dev debugging, and tag dedup status for next conversation
This commit is contained in:
@@ -26,6 +26,7 @@ require_once APP_ROOT . '/src/Controllers/ThesisCreateController.php';
|
||||
require_once APP_ROOT . '/src/AppLogger.php';
|
||||
require_once APP_ROOT . '/src/AdminLogger.php';
|
||||
require_once APP_ROOT . '/src/DuplicateThesisException.php';
|
||||
require_once APP_ROOT . '/src/ErrorHandler.php';
|
||||
|
||||
$logger = new AppLogger();
|
||||
$adminLogger = AdminLogger::make();
|
||||
@@ -47,8 +48,7 @@ try {
|
||||
|
||||
} catch (DuplicateThesisException $e) {
|
||||
$logger->logDuplicate('admin', $authorName, $e->existingThesisId, $e->existingIdentifier);
|
||||
|
||||
error_log('ThesisCreateController duplicate: ' . $e->getMessage());
|
||||
ErrorHandler::log('thesis_create_duplicate', $e, ['author' => $authorName]);
|
||||
|
||||
// Build a warning with a clickable link to the existing thesis.
|
||||
$existingUrl = htmlspecialchars('/admin/edit.php?id=' . $e->existingThesisId);
|
||||
@@ -68,10 +68,8 @@ try {
|
||||
'author' => $authorName,
|
||||
'post_keys' => array_keys($_POST),
|
||||
]);
|
||||
|
||||
error_log('ThesisCreateController error: ' . $e->getMessage());
|
||||
|
||||
App::flash('error', $e->getMessage());
|
||||
ErrorHandler::log('thesis_create', $e, ['author' => $authorName]);
|
||||
App::flash('error', ErrorHandler::userMessage($e));
|
||||
$_SESSION['form_data'] = $_POST;
|
||||
|
||||
$redirect = '../add.php';
|
||||
|
||||
Reference in New Issue
Block a user