From 7905ea8d10c4324496608ad25e5b60ce49f5d3e9 Mon Sep 17 00:00:00 2001 From: ECYaz Date: Fri, 31 Jul 2026 06:53:36 -0400 Subject: [PATCH] Guard against missing siblings on the styles demo page sibling() returns false for the first and last style in the demo list, and assign_details() read the url and id from it anyway. Harmless on production where the notice is suppressed, but any board running with DEBUG gets an error page instead of the demo. --- contribution/style/demo/demo.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contribution/style/demo/demo.php b/contribution/style/demo/demo.php index 06907ac26..d93d785bc 100644 --- a/contribution/style/demo/demo.php +++ b/contribution/style/demo/demo.php @@ -343,15 +343,15 @@ public function assign_details() return false; } - // Get siblings + // Get siblings; there is none at either end of the list $prev = $this->sibling($this->default_style, 'prev'); $next = $this->sibling($this->default_style, 'next'); $this->template->assign_vars(array( - 'U_PREV' => $prev['url'], - 'PREV_ID' => $prev['id'], - 'U_NEXT' => $next['url'], - 'NEXT_ID' => $next['id'], + 'U_PREV' => ($prev) ? $prev['url'] : false, + 'PREV_ID' => ($prev) ? $prev['id'] : false, + 'U_NEXT' => ($next) ? $next['url'] : false, + 'NEXT_ID' => ($next) ? $next['id'] : false, )); $category = '';