Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] Add update channel reset to Joomla Update Component #43717

Open
wants to merge 9 commits into
base: 5.1-dev
Choose a base branch
from
Prev Previous commit
Next Next commit
More fixes
  • Loading branch information
richard67 committed Jun 22, 2024
commit 4850b2f14ace138703f63ae54aa38e1c6e1681e6
4 changes: 2 additions & 2 deletions administrator/components/com_joomlaupdate/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public function update(InstallerAdapter $parent): bool
try {
$dbChanged = $this->resetUpdateSource();
} catch (\Throwable $e) {
$this->app->enqueueMessage(Text::_('COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED'), 'warning');
$this->app->enqueueMessage(Text::_('COM_JOOMLAUPDATE_SCRIPT_CHANGE_UPDATE_SOURCE_FAILED'), 'warning');

$dbChanged = false;
}

// Show message if update source changed
if ($dbChanged) {
$this->app->enqueueMessage(Text::_('COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK'), 'notice');
$this->app->enqueueMessage(Text::_('COM_JOOMLAUPDATE_SCRIPT_CHANGE_UPDATE_SOURCE_OK'), 'notice');
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,13 +854,25 @@ public function finaliseUpgrade()
$dbChanged = $this->resetUpdateSource();
} catch (\Throwable $e) {
$this->collectError('Reset update source to default', $e);
$msg .= Text::_('COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED') . "\n";
$msg .= Text::sprintf(
'COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED',
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT'),
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT')
)
. "\n";
$dbChanged = false;
}

// Show message if update source changed
if ($dbChanged) {
Factory::getApplication()->enqueueMessage(Text::_('COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK'), 'notice');
Factory::getApplication()->enqueueMessage(
Text::sprintf(
'COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK',
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT'),
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT')
),
'notice'
);
}

if ($msg) {
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ COM_JOOMLAUPDATE_SELF_EMPTYSTATE_CONTENT="You must update this component first b
COM_JOOMLAUPDATE_SELF_EMPTYSTATE_TITLE="A new version of the Joomla Update Component is available"
COM_JOOMLAUPDATE_SYSTEM_CHECK="System Check"
COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates"
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED="Failed to reset the update channel from \"Joomla Next\" to \"Default\". Please change it in the Joomla Update Component's options so you don't miss future updates."
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK="The update channel has been reset from \"Joomla Next\" to \"Default\"."
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED="Failed to reset the update channel from \"%1$s\" to \"%2$s\". Please change it in the Joomla Update Component's options so you don't miss future updates."
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK="The update channel has been reset from \"%1$s\" to \"%2$s\"."
COM_JOOMLAUPDATE_UPDATE_CHECK="Update Check"
COM_JOOMLAUPDATE_UPDATE_CONFIRM_BACKUP="I'm aware that a backup before any update is highly recommended."
COM_JOOMLAUPDATE_UPDATE_EMPTYSTATE_TITLE="Update your site to \"Joomla! %s\""
Expand Down
6 changes: 3 additions & 3 deletions administrator/language/en-GB/com_joomlaupdate.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ COM_JOOMLAUPDATE_DEFAULT_VIEW_DEFAULT_TITLE="View Joomla! Updates"
COM_JOOMLAUPDATE_JOOMLAUPDATE_VIEW_DISPLAY_BADGE="Display Badge"
COM_JOOMLAUPDATE_XML_DESCRIPTION="One-click update to the latest Joomla release."

; The following two strings are deprecated and will be removed with 6.0 from this file here. They will remain in file com_joomlaupdate.ini.
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED="Failed to reset the update channel from \"Joomla Next\" to \"Default\". Please change it in the Joomla Update Component's options so you don't miss future updates."
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK="The update channel has been reset from \"Joomla Next\" to \"Default\"."
; The following two strings are deprecated and will be removed with 6.0.
COM_JOOMLAUPDATE_SCRIPT_CHANGE_UPDATE_SOURCE_FAILED="Failed to reset the update channel from \"Joomla Next\" to \"Default\". Please change it in the Joomla Update Component's options so you don't miss future updates."
COM_JOOMLAUPDATE_SCRIPT_CHANGE_UPDATE_SOURCE_OK="The update channel has been reset from \"Joomla Next\" to \"Default\"."