fix: suppress license warning when download key is already configured
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Universal: Auto Version Bump / Version Bump (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Universal: Auto Version Bump / Version Bump (push) Has been cancelled
checkUpdateSite() now checks extra_query for dlid= before showing the notice. If a download key is present, no message is displayed. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -60,9 +60,12 @@ class HtmlView extends BaseHtmlView
|
||||
try {
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Find the update site ID linked to pkg_mokojoombackup
|
||||
// Find the update site linked to pkg_mokojoombackup
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('us.update_site_id'))
|
||||
->select([
|
||||
$db->quoteName('us.update_site_id'),
|
||||
$db->quoteName('us.extra_query'),
|
||||
])
|
||||
->from($db->quoteName('#__update_sites', 'us'))
|
||||
->join(
|
||||
'INNER',
|
||||
@@ -79,23 +82,25 @@ class HtmlView extends BaseHtmlView
|
||||
->setLimit(1);
|
||||
|
||||
$db->setQuery($query);
|
||||
$updateSiteId = (int) $db->loadResult();
|
||||
$site = $db->loadObject();
|
||||
|
||||
if ($updateSiteId > 0) {
|
||||
if (!$site) {
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
Text::_('COM_MOKOJOOMBACKUP_UPDATE_SITE_MISSING'),
|
||||
'warning'
|
||||
);
|
||||
} elseif (empty($site->extra_query) || strpos($site->extra_query, 'dlid=') === false) {
|
||||
// Update site exists but no download key configured
|
||||
$editUrl = Route::_(
|
||||
'index.php?option=com_installer&view=updatesites&task=updatesite.edit&id=' . $updateSiteId
|
||||
'index.php?option=com_installer&view=updatesites&filter[search]=mokojoombackup'
|
||||
);
|
||||
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
Text::sprintf('COM_MOKOJOOMBACKUP_UPDATE_SITE_NOTICE', $editUrl),
|
||||
'info'
|
||||
);
|
||||
} else {
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
Text::_('COM_MOKOJOOMBACKUP_UPDATE_SITE_MISSING'),
|
||||
'warning'
|
||||
);
|
||||
}
|
||||
// If key is present, show nothing — all good
|
||||
} catch (\Throwable $e) {
|
||||
// Non-critical — silently ignore
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user