diff --git a/classes/plugin/SafeUpgradeManager.php b/classes/plugin/SafeUpgradeManager.php index 5fd78cf1..532a043e 100644 --- a/classes/plugin/SafeUpgradeManager.php +++ b/classes/plugin/SafeUpgradeManager.php @@ -1204,12 +1204,8 @@ class SafeUpgradeManager $report['psr_log_conflicts'] = $this->detectPsrLogConflictsLocal(); $report['monolog_conflicts'] = $this->detectMonologConflictsLocal(); - if ($report['plugins_pending']) { - if ($report['is_major_minor_upgrade']) { - $report['blocking'][] = 'Plugin and theme updates must be applied before upgrading Grav.'; - } else { - $report['warnings'][] = 'Pending plugin/theme updates detected; updating before upgrading Grav is recommended.'; - } + if ($report['plugins_pending'] && $report['is_major_minor_upgrade']) { + $report['blocking'][] = 'Pending plugin/theme updates detected. Because this is a major Grav upgrade, update them before continuing.'; } if ($report['psr_log_conflicts']) { diff --git a/languages/en.yaml b/languages/en.yaml index 2f8a8d3d..03a0941a 100644 --- a/languages/en.yaml +++ b/languages/en.yaml @@ -513,8 +513,9 @@ PLUGIN_ADMIN: SAFE_UPGRADE_WARNINGS_MONOLOG_ITEM: "Potential Monolog conflict:" SAFE_UPGRADE_WARNINGS_MONOLOG_UNKNOWN: "Review the plugin for potential API changes." SAFE_UPGRADE_PENDING_UPDATES: "Pending plugin or theme updates" - SAFE_UPGRADE_PENDING_INTRO: "Review the extensions that should be updated first." - SAFE_UPGRADE_PENDING_HINT: "Update all plugins and themes before proceeding." + SAFE_UPGRADE_PENDING_INTRO: "Because this is a major Grav upgrade, update these extensions first to ensure maximum compatibility." + SAFE_UPGRADE_PENDING_MINOR_DESC: "These updates are optional for this release; apply them at your convenience." + SAFE_UPGRADE_PENDING_HINT: "Because this is a major upgrade, update all plugins and themes before continuing to ensure maximum compatibility." SAFE_UPGRADE_UNKNOWN_VERSION: "unknown" SAFE_UPGRADE_REQUIREMENTS_FAIL: "PHP %s or newer is required before continuing." SAFE_UPGRADE_DISABLED: "Safe upgrade is disabled. Enable it in Configuration ▶ System ▶ Updates." diff --git a/themes/grav/app/updates/safe-upgrade.js b/themes/grav/app/updates/safe-upgrade.js index c9947d55..25bf1149 100644 --- a/themes/grav/app/updates/safe-upgrade.js +++ b/themes/grav/app/updates/safe-upgrade.js @@ -225,6 +225,8 @@ export default class SafeUpgrade { const pending = (data.preflight && data.preflight.plugins_pending) || {}; const psrConflicts = (data.preflight && data.preflight.psr_log_conflicts) || {}; const monologConflicts = (data.preflight && data.preflight.monolog_conflicts) || {}; + const isMajorUpgrade = !!(data.preflight && data.preflight.is_major_minor_upgrade); + const hasPendingUpdates = Object.keys(pending).length > 0; if (data.status === 'error') { blockers.push(data.message || t('SAFE_UPGRADE_GENERIC_ERROR', 'Safe upgrade could not complete. See Grav logs for details.')); @@ -251,8 +253,8 @@ export default class SafeUpgrade { blockers.push(t('SAFE_UPGRADE_NOT_AVAILABLE', 'No Grav update is available.')); } - if (Object.keys(pending).length) { - blockers.push(t('SAFE_UPGRADE_PENDING_HINT', 'Update all plugins and themes before proceeding.')); + if (hasPendingUpdates && isMajorUpgrade) { + blockers.push(t('SAFE_UPGRADE_PENDING_HINT', 'Because this is a major upgrade, update all plugins and themes before continuing to ensure maximum compatibility.')); } const psrWarningItems = Object.keys(psrConflicts).map((slug) => { @@ -303,14 +305,17 @@ export default class SafeUpgrade { ` : ''; - const pendingList = Object.keys(pending).length ? ` + const pendingList = hasPendingUpdates ? `
${t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates')} - ${t('SAFE_UPGRADE_PENDING_INTRO', 'Review the extensions that should be updated first.')} + ${isMajorUpgrade + ? t('SAFE_UPGRADE_PENDING_INTRO', 'Because this is a major Grav upgrade, update these extensions first to ensure maximum compatibility.') + : t('SAFE_UPGRADE_PENDING_MINOR_DESC', 'These updates are optional for this release; apply them at your convenience.') + }
diff --git a/themes/grav/js/admin.min.js b/themes/grav/js/admin.min.js index 4ee082b6..b7edd2f8 100644 --- a/themes/grav/js/admin.min.js +++ b/themes/grav/js/admin.min.js @@ -2431,8 +2431,10 @@ var SafeUpgrade = /*#__PURE__*/function () { var version = data.version || {}; var releaseDate = version.release_date || ''; var packageSize = version.package_size ? formatBytes(version.package_size) : t('SAFE_UPGRADE_UNKNOWN_SIZE', 'unknown'); - var warnings = data.preflight && data.preflight.warnings || []; +var warnings = data.preflight && data.preflight.warnings || []; var pending = data.preflight && data.preflight.plugins_pending || {}; + var isMajorUpgrade = !!(data.preflight && data.preflight.is_major_minor_upgrade); + var hasPendingUpdates = Object.keys(pending).length > 0; var psrConflicts = data.preflight && data.preflight.psr_log_conflicts || {}; var monologConflicts = data.preflight && data.preflight.monolog_conflicts || {}; if (data.status === 'error') { @@ -2454,8 +2456,8 @@ var SafeUpgrade = /*#__PURE__*/function () { if (!data.upgrade_available) { blockers.push(t('SAFE_UPGRADE_NOT_AVAILABLE', 'No Grav update is available.')); } - if (Object.keys(pending).length) { - blockers.push(t('SAFE_UPGRADE_PENDING_HINT', 'Update all plugins and themes before proceeding.')); + if (hasPendingUpdates && isMajorUpgrade) { + blockers.push(t('SAFE_UPGRADE_PENDING_HINT', 'Because this is a major upgrade, update all plugins and themes before continuing to ensure maximum compatibility.')); } var psrWarningItems = Object.keys(psrConflicts).map(function (slug) { var info = psrConflicts[slug] || {}; @@ -2481,7 +2483,7 @@ var SafeUpgrade = /*#__PURE__*/function () { var warningsList = filteredWarnings.length || psrWarningItems.length || monologWarningItems.length ? "\n
\n
\n
\n \n
\n ".concat(t('SAFE_UPGRADE_WARNINGS', 'Warnings'), "\n ").concat(t('SAFE_UPGRADE_WARNINGS_HINT', 'These items may require attention before continuing.'), "\n
\n
\n
\n
\n
    \n ").concat(filteredWarnings.map(function (warning) { return "
  • ".concat(warning, "
  • "); }).join(''), "\n ").concat(psrWarningItems.join(''), "\n ").concat(monologWarningItems.join(''), "\n
\n
\n
\n ") : ''; - var pendingList = Object.keys(pending).length ? "\n
\n
\n
\n \n
\n ".concat(t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates'), "\n ").concat(t('SAFE_UPGRADE_PENDING_INTRO', 'Review the extensions that should be updated first.'), "\n
\n
\n
\n
\n
    \n ").concat(Object.keys(pending).map(function (slug) { +var pendingList = hasPendingUpdates ? "\n
    \n
    \n
    \n \n
    \n ".concat(t('SAFE_UPGRADE_PENDING_UPDATES', 'Pending plugin or theme updates'), "\n ").concat(isMajorUpgrade ? t('SAFE_UPGRADE_PENDING_INTRO', 'Because this is a major Grav upgrade, update these extensions first to ensure maximum compatibility.') : t('SAFE_UPGRADE_PENDING_MINOR_DESC', 'These updates are optional for this release; apply them at your convenience.'), "\n
    \n
    \n
    \n
    \n
      \n ").concat(Object.keys(pending).map(function (slug) { var item = pending[slug] || {}; var type = item.type || 'plugin'; var current = item.current || t('SAFE_UPGRADE_UNKNOWN_VERSION', 'unknown');