diff --git a/_tests/tests/cli_tests/_broken_links.php b/_tests/tests/cli_tests/_broken_links.php index 4ce31fa639b3f399ef5afa3c93448855526e3dcc..80a4117fcbb2499205256d5f301eb9d58031eb79 100644 --- a/_tests/tests/cli_tests/_broken_links.php +++ b/_tests/tests/cli_tests/_broken_links.php @@ -274,7 +274,7 @@ class _broken_links_test_set extends cms_test_case if (preg_match('#^https://twitter\.com/intent/tweet\?text=#', $url) != 0) { return; } - if (preg_match('#^https://compo\.sr/uploads/website_specific/compo\.sr/scripts/build_personal_upgrader\.php#', $url) != 0) { + if (preg_match('#^https://compo\.sr/uploads/website_specific/compo\.sr/scripts/build_personal_upgrader\.php#', $url) != 0) { // LEGACY return; } if (in_array($url, [ diff --git a/sources_custom/cms_homesite_make_upgrader.php b/sources_custom/cms_homesite_make_upgrader.php index 2f10407b16f8a6cc473e18a71f4e94b33cfd983e..00cdaf889f96ae8ae3e19b4b5947241c30319c26 100644 --- a/sources_custom/cms_homesite_make_upgrader.php +++ b/sources_custom/cms_homesite_make_upgrader.php @@ -66,10 +66,15 @@ function make_upgrade_get_path($from_version_dotted, $to_version_dotted, $addons $version_parts_a = explode('.', $from_version_dotted); $a = intval($version_parts_a[0]); - if (get_base_url() == 'https://composr.app' || get_base_url() == 'https://www.composr.app') { + if ((get_base_url() == 'https://composr.app') || (get_base_url() == 'https://www.composr.app')) { if (($a == 10) && ($b >= 11)) { // TODO: remove when v11 is stable attach_message('It is strongly recommended not to upgrade a version 10 site to version 11 until version 11 enters beta status. You will likely break your site! Proceed at your own risk and only if you are just testing and have taken proper backups.', 'warn'); } + + // LEGACY: Cannot upgrade <11.alpha4 to 11.beta or higher; must first upgrade to 11.alpha4 + if ((strpos($from_version_pretty, '11 alpha') === 0) && ($from_version_pretty != '11 alpha4') && (strpos($to_version_pretty, '11 alpha') === false)) { + return [null, 'You need to upgrade to 11 alpha4 first before upgrading to a later release. This is because changes made in the upgrader will corrupt your site if you immediately skip 11 alpha4. Please go to <a href="https://composr.app/news/view/releases/composr-11-alpha4.htm?blog=0">this news article</a> (Make a Composr upgrader box) to upgrade to 11 alpha4. After upgrading fully to 11 alpha4, run the upgrader again normally, and you should be able to then upgrade to the latest release.']; + } } } diff --git a/sources_custom/hooks/endpoints/cms_homesite/personal_upgrader.php b/sources_custom/hooks/endpoints/cms_homesite/personal_upgrader.php index cd8c74fe69b52a6577963ddfa8d6da501c0bd06a..baa780f2f3ab4348057c139848672b20117d3481 100644 --- a/sources_custom/hooks/endpoints/cms_homesite/personal_upgrader.php +++ b/sources_custom/hooks/endpoints/cms_homesite/personal_upgrader.php @@ -64,6 +64,10 @@ class Hook_endpoint_cms_homesite_personal_upgrader // Uh oh! We probably do not have a stable version up. if ($to_version_dotted === null) { + if ($id === '_LEGACY_') { // LEGACY + warn_exit(protect_from_escaping('Internal Error: We do not know what version you want to upgrade to, and there are no stable versions in the system (which we use as the default). Please generate an upgrade file from ' . get_brand_base_url() . ', in the news article for the newest release. You can then use this in the upgrader when transferring across new / updated files. You may have to re-load the upgrader manually by going to baseurl/upgrader.php so you do not get this error again.')); + exit(); + } return ['success' => false, 'error_details' => 'Internal Error: We do not know what version you want to upgrade to, and there are no stable versions in the system (which we use as the default). Please generate an upgrade file from ' . get_brand_base_url() . ', in the news article for the newest release. You can then use this in the upgrader when transferring across new / updated files. You may have to re-load the upgrader manually by going to baseurl/upgrader.php so you do not get this error again.']; }