From 348302b7db5b40474c75ad84211027911c516960 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Pardou?=
<571533+jrmi@users.noreply.github.com>
Date: Wed, 25 Feb 2026 16:30:42 +0100
Subject: [PATCH] Fix builder error page (#4867)
---
.../bug/use_error_page_in_preview.json | 9 ++++++
.../components/PublicSiteErrorPage.vue | 32 +++++++++++--------
.../modules/builder/errorPageTypes.js | 3 +-
3 files changed, 30 insertions(+), 14 deletions(-)
create mode 100644 changelog/entries/unreleased/bug/use_error_page_in_preview.json
diff --git a/changelog/entries/unreleased/bug/use_error_page_in_preview.json b/changelog/entries/unreleased/bug/use_error_page_in_preview.json
new file mode 100644
index 0000000000..a49e78d323
--- /dev/null
+++ b/changelog/entries/unreleased/bug/use_error_page_in_preview.json
@@ -0,0 +1,9 @@
+{
+ "type": "bug",
+ "message": "Use error page in preview",
+ "issue_origin": "github",
+ "issue_number": null,
+ "domain": "builder",
+ "bullet_points": [],
+ "created_at": "2026-02-25"
+}
\ No newline at end of file
diff --git a/web-frontend/modules/builder/components/PublicSiteErrorPage.vue b/web-frontend/modules/builder/components/PublicSiteErrorPage.vue
index fc9c5201ec..28ad28987b 100644
--- a/web-frontend/modules/builder/components/PublicSiteErrorPage.vue
+++ b/web-frontend/modules/builder/components/PublicSiteErrorPage.vue
@@ -3,8 +3,8 @@
@@ -52,22 +52,28 @@ export default {
content() {
return this.error.content || this.$t('errorLayout.error')
},
+ routeName() {
+ return this.$route.name
+ },
},
methods: {
onHome() {
if (
- this.$route.name === 'application-builder-page' &&
- this.$route.params.pathMatch === '/'
+ ['application-builder-page', 'application-builder-preview'].includes(
+ this.routeName
+ )
) {
- // Reload the current page
- this.$router.go(0)
- } else {
- // Navigate to the home route
- this.$router.push({
- name: 'application-builder-page',
- params: { pathMatch: '/' },
- query: null, // Remove query parameters
- })
+ if (this.$route.params.pathMatch === '/') {
+ // Reload the current page
+ this.$router.go(0)
+ } else {
+ // Navigate to the home route
+ this.$router.push({
+ name: this.routeName,
+ params: { pathMatch: '' },
+ query: null, // Remove query parameters
+ })
+ }
}
},
},
diff --git a/web-frontend/modules/builder/errorPageTypes.js b/web-frontend/modules/builder/errorPageTypes.js
index 0ad3579a72..0dff3393bc 100644
--- a/web-frontend/modules/builder/errorPageTypes.js
+++ b/web-frontend/modules/builder/errorPageTypes.js
@@ -8,7 +8,8 @@ export class PublicSiteErrorPageType extends ErrorPageType {
isApplicable() {
return (
- this.app.$router.currentRoute.value.name === 'application-builder-page'
+ this.app.$router.currentRoute.value.name === 'application-builder-page' ||
+ this.app.$router.currentRoute.value.name === 'application-builder-preview'
)
}