diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d10a329..7f440135 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +### [1.24.2](https://github.com/eea/volto-eea-website-theme/compare/1.24.1...1.24.2) - 4 December 2023 + +#### :bug: Bug Fixes + +- fix: check if schema has properties.data - refs #261239 [dobri1408 - [`b2a5faf`](https://github.com/eea/volto-eea-website-theme/commit/b2a5fafa8e41a4ea2d5124f8f6cd3e6bbd276a21)] + ### [1.24.1](https://github.com/eea/volto-eea-website-theme/compare/1.24.0...1.24.1) - 27 November 2023 #### :nail_care: Enhancements diff --git a/package.json b/package.json index f77e67c6..f265c78c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-eea-website-theme", - "version": "1.24.1", + "version": "1.24.2", "description": "@eeacms/volto-eea-website-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/index.js b/src/index.js index 0c03dddf..e9152351 100644 --- a/src/index.js +++ b/src/index.js @@ -67,6 +67,15 @@ function tabVariationCustomization(tabs_block_variations, config) { const schema = (oldSchemaEnhancer ? oldSchemaEnhancer(props) : props) .schema; const oldSchemaExtender = schema.properties?.data?.schemaExtender; + + //check before if schema.properties.data exists + if (!schema?.properties?.data) { + schema.properties = { + ...schema.properties, + data: {}, + }; + } + schema.properties.data.schemaExtender = (schema, child) => { const innerSchema = oldSchemaExtender ? oldSchemaExtender(schema, child)