Do not show disabled plugins in the update list

Fixes #1716
This commit is contained in:
Samuel Georges 2016-03-25 12:37:15 +11:00
parent 010cd403f5
commit 0950959904
2 changed files with 15 additions and 3 deletions

View File

@ -211,6 +211,7 @@ class UpdateManager
$names = $installed->lists('name', 'code');
$icons = $installed->lists('icon', 'code');
$frozen = $installed->lists('is_frozen', 'code');
$updatable = $installed->lists('is_updatable', 'code');
$build = Parameters::get('system::core.build');
$params = [
@ -245,10 +246,13 @@ class UpdateManager
$info['icon'] = isset($icons[$code]) ? $icons[$code] : false;
/*
* If plugin has updates frozen, do not add it to the list
* and discount an update unit.
* If a plugin has updates frozen, or cannot be updated,
* do not add to the list and discount an update unit.
*/
if (isset($frozen[$code]) && $frozen[$code]) {
if (
(isset($frozen[$code]) && $frozen[$code]) ||
(isset($updatable[$code]) && !$updatable[$code])
) {
$updateCount = max(0, --$updateCount);
}
else {

View File

@ -79,7 +79,15 @@ class PluginVersion extends Model
$this->description = Lang::get('system::lang.plugins.unknown_plugin');
$this->orphaned = true;
}
}
/**
* Returns true if the plugin should be updated by the system.
* @return bool
*/
public function getIsUpdatableAttribute()
{
return !$this->is_disabled && !$this->disabledBySystem && !$this->disabledByConfig;
}
/**