Date: Tue, 22 Sep 2026 21:16:27 +0100
Subject: [PATCH 11/25] fix: only render the version floor notice when the
source reports a floor
---
src/php/Settings/Version_Switch.php | 3 +-
tests/unit/Settings/Version_Switch_Test.php | 43 +++++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/src/php/Settings/Version_Switch.php b/src/php/Settings/Version_Switch.php
index a53242d38..db28615c0 100644
--- a/src/php/Settings/Version_Switch.php
+++ b/src/php/Settings/Version_Switch.php
@@ -476,7 +476,8 @@ public static function render_version_switch_field(): void {
return;
}
- $floor_notice = self::get_source()->get_floor_notice( self::get_version_floor() );
+ $floor = self::get_version_floor();
+ $floor_notice = $floor ? self::get_source()->get_floor_notice( $floor ) : '';
?>
diff --git a/tests/unit/Settings/Version_Switch_Test.php b/tests/unit/Settings/Version_Switch_Test.php
index 51f267c2f..6a09bc90e 100644
--- a/tests/unit/Settings/Version_Switch_Test.php
+++ b/tests/unit/Settings/Version_Switch_Test.php
@@ -693,6 +693,49 @@ public function test_last_error_code_tolerates_the_previous_transient_shape(): v
$this->assertSame( '', Version_Switch::get_last_error_message() );
}
+ /**
+ * A source that reports no floor has nothing to explain, so the floor notice
+ * is not rendered at all.
+ *
+ * @return void
+ */
+ public function test_floor_notice_is_omitted_when_the_source_reports_no_floor(): void {
+ $this->register_test_services();
+ $this->seed_catalogue( '3.9.2' );
+
+ $output = $this->render_version_switch_field();
+
+ $this->assertStringContainsString( '