From 1e22964ff5d09e5946dc432248b9d5caf84633a5 Mon Sep 17 00:00:00 2001 From: Abhishek-17H Date: Wed, 18 Dec 2024 21:48:10 +0530 Subject: [PATCH 1/2] Bugfix remove query string inclusion in body class generation logic --- packages/volto/news/6493.bugfix | 1 + packages/volto/src/components/theme/App/App.jsx | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 packages/volto/news/6493.bugfix diff --git a/packages/volto/news/6493.bugfix b/packages/volto/news/6493.bugfix new file mode 100644 index 0000000000..3594887b3e --- /dev/null +++ b/packages/volto/news/6493.bugfix @@ -0,0 +1 @@ +Fixed body class handling to prevent query string inclusion in is-adding-contenttype.@Abhishek-17h \ No newline at end of file diff --git a/packages/volto/src/components/theme/App/App.jsx b/packages/volto/src/components/theme/App/App.jsx index 1c900fefe1..cda1be4085 100644 --- a/packages/volto/src/components/theme/App/App.jsx +++ b/packages/volto/src/components/theme/App/App.jsx @@ -146,10 +146,13 @@ export class App extends Component { this.props.pathname !== '/', siteroot: this.props.pathname === '/', [`is-adding-contenttype-${decodeURIComponent( - this.props.location?.search?.replace('?type=', ''), + this.props.location?.search?.startsWith('?type=') + ? this.props.location?.search?.replace('?type=', '') + : '', ) .replaceAll(' ', '-') - .toLowerCase()}`]: this.props.location?.search, + .toLowerCase()}`]: + this.props.location?.search?.startsWith('?type='), 'is-authenticated': !!this.props.token, 'is-anonymous': !this.props.token, 'cms-ui': isCmsUI, From 93cbb0fa46108808918bdc58b0f1a722419c68a1 Mon Sep 17 00:00:00 2001 From: Bhanudas Hegaje Date: Thu, 19 Dec 2024 16:36:37 +0530 Subject: [PATCH 2/2] Update packages/volto/news/6493.bugfix Co-authored-by: Steve Piercy --- packages/volto/news/6493.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/volto/news/6493.bugfix b/packages/volto/news/6493.bugfix index 3594887b3e..a5e5c9aad3 100644 --- a/packages/volto/news/6493.bugfix +++ b/packages/volto/news/6493.bugfix @@ -1 +1 @@ -Fixed body class handling to prevent query string inclusion in is-adding-contenttype.@Abhishek-17h \ No newline at end of file +No longer add classes from the query string search text in the `body` tag. @Abhishek-17h \ No newline at end of file