diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index ee360bb85..829f3d03d 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -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 { diff --git a/modules/system/models/PluginVersion.php b/modules/system/models/PluginVersion.php index 0754e4223..02513e8f1 100644 --- a/modules/system/models/PluginVersion.php +++ b/modules/system/models/PluginVersion.php @@ -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; } /**