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

Fix installation of plugin updates - honour user's choice #827

Merged
merged 1 commit into from Nov 5, 2022

Conversation

mw9
Copy link
Contributor

@mw9 mw9 commented Nov 4, 2022

This proposed change corrects the behaviour of the Plugin management settings page.

When a plugin update is available, the settings page provides the user with a checkbox option that should determine whether or not the update is to be installed. But, at present, the update will always be performed regardless of the user's choice.

The issue was raised in this forum post: Plugins update when not selected.

The proposed change corrects this behaviour. Plugins will now only be updated if the user has explicitly made the choice, or if plugins are updated automatically (setting: 'Update plugins automatically'). It has been tested both in LMS' default skin, and in the Material skin.

This change corrects the behaviour of the Plugin management settings page.

At present, an available plugin update will be installed whenever settings are
saved, without regard to the user's choice in the matter.

The settings page provides the user with a checkbox option that should
determine whether or not the update is installed. But the state of this option
is not being properly determined.

The problem lies with the use of the condition 'exists $params->{"install:$plugin"}'.
This condition will be set true when a plugin has been selected for first time
installation. But it is also set true while the plugin remains installed.

The condition 'exists $params->{"update:$plugin"}' indicates that the user has
chosen to install an update.

The current logic assumes that only one of the conditions
'exists $params->{"install:$plugin"}' and 'exists $params->{"update:$plugin"}'
will ever be true at the same time. Were that the case, the code would cater
for both first time installation and update installation correctly. But the
assumption is incorrect. 'exists $params->{"install:$plugin"}' is also true
whenever a plugin update is available.

The consequence is that plugin updates are installed without regard to the
user's choice.

This change deals with the issue by distinguishing a first time installation
from the installation of a subsequent update, and using the correct logic for
each case.
@mherger mherger merged commit d213176 into LMS-Community:public/8.3 Nov 5, 2022
@mherger
Copy link
Contributor

mherger commented Nov 5, 2022

Looking good, thanks!

@mw9 mw9 deleted the feature/fix_plugin_updater branch November 5, 2022 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants