feat: add dynamic version badge and migrate content/module references
Add shields.io dynamic version badge (from Gitea releases) to both templateDetails.xml and sys.ini descriptions. Extend migration script to replace MokoCassiopeia references in article content and custom HTML modules. Fix ROADMAP.md repo URLs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -172,6 +172,68 @@ use Joomla\CMS\Log\Log;
|
||||
}
|
||||
}
|
||||
|
||||
// Replace MokoCassiopeia references in article content
|
||||
try {
|
||||
$contentTables = [
|
||||
['table' => '#__content', 'columns' => ['introtext', 'fulltext']],
|
||||
];
|
||||
|
||||
$totalReplaced = 0;
|
||||
|
||||
foreach ($contentTables as $spec) {
|
||||
foreach ($spec['columns'] as $col) {
|
||||
$query = $db->getQuery(true)
|
||||
->update($spec['table'])
|
||||
->set(
|
||||
$db->quoteName($col) . ' = REPLACE(REPLACE('
|
||||
. $db->quoteName($col) . ', '
|
||||
. $db->quote($oldDisplay) . ', '
|
||||
. $db->quote($newDisplay) . '), '
|
||||
. $db->quote($oldName) . ', '
|
||||
. $db->quote($newName) . ')'
|
||||
)
|
||||
->where(
|
||||
'(' . $db->quoteName($col) . ' LIKE ' . $db->quote('%' . $oldDisplay . '%')
|
||||
. ' OR ' . $db->quoteName($col) . ' LIKE ' . $db->quote('%' . $oldName . '%') . ')'
|
||||
);
|
||||
$db->setQuery($query)->execute();
|
||||
$totalReplaced += $db->getAffectedRows();
|
||||
}
|
||||
}
|
||||
|
||||
if ($totalReplaced > 0) {
|
||||
$log("Replaced MokoCassiopeia references in {$totalReplaced} content row(s).");
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$log('Content replacement failed: ' . $e->getMessage(), Log::WARNING);
|
||||
}
|
||||
|
||||
// Replace MokoCassiopeia references in custom HTML modules
|
||||
try {
|
||||
$query = $db->getQuery(true)
|
||||
->update('#__modules')
|
||||
->set(
|
||||
$db->quoteName('content') . ' = REPLACE(REPLACE('
|
||||
. $db->quoteName('content') . ', '
|
||||
. $db->quote($oldDisplay) . ', '
|
||||
. $db->quote($newDisplay) . '), '
|
||||
. $db->quote($oldName) . ', '
|
||||
. $db->quote($newName) . ')'
|
||||
)
|
||||
->where(
|
||||
'(' . $db->quoteName('content') . ' LIKE ' . $db->quote('%' . $oldDisplay . '%')
|
||||
. ' OR ' . $db->quoteName('content') . ' LIKE ' . $db->quote('%' . $oldName . '%') . ')'
|
||||
);
|
||||
$db->setQuery($query)->execute();
|
||||
$modulesUpdated = $db->getAffectedRows();
|
||||
|
||||
if ($modulesUpdated > 0) {
|
||||
$log("Replaced MokoCassiopeia references in {$modulesUpdated} module(s).");
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$log('Module content replacement failed: ' . $e->getMessage(), Log::WARNING);
|
||||
}
|
||||
|
||||
// Update the update server
|
||||
try {
|
||||
$onyxUpdatesUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/raw/branch/main/updates.xml';
|
||||
|
||||
Reference in New Issue
Block a user