Skip to content

Use file fallback for About Us pages - #824

Open
suread wants to merge 3 commits into
Women-Coding-Community:mainfrom
suread:fix/754-file-fallback-for-about-us-cms-pages
Open

suread wants to merge 3 commits into
Women-Coding-Community:mainfrom
suread:fix/754-file-fallback-for-about-us-cms-pages

Conversation

@suread

@suread suread commented Oct 31, 2026

Copy link
Copy Markdown

Description

Changes

  • All About Us pages (Team, Collaborator, Code of Conduct, About Us, Celebrate Her, Partners) updated to return fallback using the JSON in init-data instead of throwing ContentNotFoundException (404 for end user)
Endpoint Before After
/api/cms/v1/about 404 200
/api/cms/v1/celebrateHer 404 200
/api/cms/v1/code-of-conduct 404 200
/api/cms/v1/collaborators 404 200
/api/cms/v1/partners 404 200
/api/cms/v1/team 404 200

Why is this change required?

  • Unseeded database returned a ContentNotFoundException giving rise to a 404. Now it uses existing init-data json to serve a fallback page

What problem does it solve?

  • Documented behaviour (docs/qa_local_setup.md, scripts/seed-about-pages.sh) for About-Us pages is static fallback if no DB row in page table. Before the fix, the actual behaviour was 404 Content Not Found

Steps to reproduce:

  1. Start an unseeded Postgres DB (docker compose -f docker/docker-compose.yml up postgres)
  2. Run PlatformApplication
  3. Check the DB is empty: select id from page; returns no rows
  4. Call /api/cms/v1/team in Swagger
  5. See 404 before the fix and 200 with the fallback content after it

Additional notes

  • Collaborators is paginated when found in database - fallback version is not as existing fallback mechanism for Events page was used as a guide. Changing page number and page size has no effect on content returned.
  • If fallback Collaborators page should be paginated, I can raise this as an issue and fix
  • The tests mock getFallback; they don’t read the bundled JSON files.

Related Issue

Fixes #754

Change Type

  • Bug Fix
  • New Feature
  • Code Refactor
  • Documentation
  • Test
  • Other

Screenshots

Team page - before fix
Screenshot 2026-10-31 105311

Collaborators page - before fix
Screenshot 2026-10-31 105046

Team page - after fix
Screenshot 2026-10-31 105831

Collaborators page - after fix
Screenshot 2026-10-31 110335

About us page - after fix
Screenshot 2026-10-31 111007

Celebrate Her page - after fix
Screenshot 2026-10-31 111055

Code of Conduct page - after fix
Screenshot 2026-10-31 111144

Partners page - after fix
Screenshot 2026-10-31 111243

Pull request checklist

Please check if your PR fulfills the following requirements:

Use PageRepository.getFallback instead of throwing
ContentNotFoundException when the Team page has no row in the database.
A fresh database now serves the bundled JSON instead of returning 404.

Replace the not-found test with one asserting the fallback page is
returned.
Use PageRepository.getFallback instead of throwing
ContentNotFoundException when the Partners, Code of Conduct, About Us
or Celebrate Her pages have no row in the database. A fresh database now
serves the bundled JSON instead of returning 404.

Replace the not-found tests with tests asserting the fallback page is
returned.
Use PageRepository.getFallback instead of throwing
ContentNotFoundException when the Collaborator page has no row in the
database. A fresh database now serves the bundled JSON instead of
returning 404.

Return the fallback page without pagination, matching
EventService.getEvents.

Replace the not-found test with test asserting the fallback page is
returned.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: About-Us CMS pages have no file fallback; fresh DB returns 404

1 participant