From 63dfa22255e2495847a1a2af833bb960533001d4 Mon Sep 17 00:00:00 2001 From: Tudor Date: Sun, 29 Mar 2026 10:12:07 +0100 Subject: [PATCH] fix(detail): detect secondary schools by attainment_8_score, not just phase field Schools with phases like "All-through" or null phase but with GCSE data were falling through to the primary SchoolDetailView, rendering only partial content. Now checks yearly_data for attainment_8_score as well. Co-Authored-By: Claude Opus 4.6 --- nextjs-app/app/school/[urn]/page.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nextjs-app/app/school/[urn]/page.tsx b/nextjs-app/app/school/[urn]/page.tsx index 27f1134..04df878 100644 --- a/nextjs-app/app/school/[urn]/page.tsx +++ b/nextjs-app/app/school/[urn]/page.tsx @@ -27,7 +27,8 @@ export async function generateMetadata({ params }: SchoolPageProps): Promise d.attainment_8_score != null); const title = `${school_info.school_name} | ${school_info.local_authority || 'England'}`; const description = isSecondary ? `View GCSE results, Attainment 8, Progress 8 and school statistics for ${school_info.school_name}${school_info.local_authority ? ` in ${school_info.local_authority}` : ''}.` @@ -85,7 +86,8 @@ export default async function SchoolPage({ params }: SchoolPageProps) { const { school_info, yearly_data, absence_data, ofsted, parent_view, census, admissions, sen_detail, phonics, deprivation, finance } = data; - const isSecondary = (school_info.phase ?? '').toLowerCase().includes('secondary'); + const isSecondary = (school_info.phase ?? '').toLowerCase().includes('secondary') + || yearly_data.some((d: any) => d.attainment_8_score != null); // Generate JSON-LD structured data for SEO const structuredData = {