Skip to content

Commit 8ca9a8d

Browse files
committed
fix error when mysql uses capital letters in column name
1 parent a31535b commit 8ca9a8d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Components/Entity/ComponentUpdate.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ public function update(string $targetVersion)
283283

284284
// save current version to system component
285285
$this->setValue('com_version', $mainVersion . '.' . $minorVersion . '.0');
286+
if ($mainVersion === ADMIDIO_VERSION_MAIN && $minorVersion === ADMIDIO_VERSION_MINOR) {
287+
$this->setValue('com_beta', ADMIDIO_VERSION_BETA);
288+
}
286289
$this->save();
287290

288291
// output of the version number for better debugging

src/InstallationUpdate/Service/UpdateStepsCode.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public static function updateStep51ConvertCharsetToUtf8mb4(): void
6464

6565
$admidioTables = self::$db->queryPrepared($sql, array($g_adm_db, $g_tbl_praefix . '_%'));
6666
while ($row = $admidioTables->fetch()) {
67-
$sql = 'ALTER TABLE ' . $row['TABLE_NAME'] . ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci';
67+
$tableName = isset($row['table_name']) ? $row['table_name'] : (isset($row['TABLE_NAME']) ? $row['TABLE_NAME'] : null);
68+
$sql = 'ALTER TABLE ' . $tableName . ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci';
6869
self::$db->queryPrepared($sql);
6970
}
7071
}

0 commit comments

Comments
 (0)