Merge branch 'QA_5_2'

This commit is contained in:
William Desportes 2026-03-17 14:07:33 +01:00
commit 8b88e6d2af
No known key found for this signature in database
GPG Key ID: 70684F4717D49A31

View File

@ -542,25 +542,28 @@ class Tracking
. '</a>]</h3>';
$trackedData = $this->getTrackedData($db, $table, $version);
// Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements
$dropCreateStatements = $trackedData->ddlog[0]['statement'];
// ddlog can be empty if all statements are deleted
if ($trackedData->ddlog !== []) {
// Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements
$dropCreateStatements = $trackedData->ddlog[0]['statement'];
if (
str_contains($trackedData->ddlog[0]['statement'], 'DROP TABLE')
|| str_contains($trackedData->ddlog[0]['statement'], 'DROP VIEW')
) {
$dropCreateStatements .= $trackedData->ddlog[1]['statement'];
if (
str_contains($trackedData->ddlog[0]['statement'], 'DROP TABLE')
|| str_contains($trackedData->ddlog[0]['statement'], 'DROP VIEW')
) {
$dropCreateStatements .= $trackedData->ddlog[1]['statement'];
}
// Print SQL code
$html .= Generator::getMessage(
sprintf(
__('Version %s snapshot (SQL code)'),
htmlspecialchars($version),
),
$dropCreateStatements,
);
}
// Print SQL code
$html .= Generator::getMessage(
sprintf(
__('Version %s snapshot (SQL code)'),
htmlspecialchars($version),
),
$dropCreateStatements,
);
// Unserialize snapshot
$temp = Core::safeUnserialize($trackedData->schemaSnapshot);
if ($temp === null) {