@@ -106,12 +106,15 @@ private function processSimpleEditableData(HeadlessResponse $data): array
106106 $ normalizedData = [];
107107
108108 $ config = $ data ->getEditableConfiguration ();
109+ $ editableType = $ data ->getEditableType ();
109110 $ elementData = $ data ->getInlineConfigElementData ();
110111
111112 foreach ($ elementData as $ configName => $ configData ) {
112113
113114 if (array_key_exists ('property_normalizer ' , $ config ) && $ config ['property_normalizer ' ] !== null ) {
114115 $ configData = $ this ->applyNormalizer ($ config ['property_normalizer ' ], $ configData );
116+ } elseif (null !== $ defaultNormalizer = $ this ->getDefaultNormalizer ($ editableType )) {
117+ $ configData = $ this ->applyNormalizer ($ defaultNormalizer , $ configData );
115118 } elseif ($ configData instanceof Editable) {
116119 $ configData = $ configData ->render ();
117120 } else {
@@ -144,8 +147,12 @@ private function processElementData(HeadlessResponse $data, string $areaName): a
144147 $ configData = $ this ->applyNormalizer ($ configElements [$ configName ], $ configData );
145148 } elseif ($ configBlockName !== 'additional_property_normalizer ' ) {
146149 $ configNode = $ this ->findBrickConfigNode ($ configName , $ configElements );
147- if ($ configNode !== null && $ configNode ['property_normalizer ' ] !== null ) {
148- $ configData = $ this ->applyNormalizer ($ configNode ['property_normalizer ' ], $ configData );
150+ if ($ configNode !== null ) {
151+ if ($ configNode ['property_normalizer ' ] !== null ) {
152+ $ configData = $ this ->applyNormalizer ($ configNode ['property_normalizer ' ], $ configData );
153+ } elseif (null !== $ defaultNormalizer = $ this ->getDefaultNormalizer ($ configNode ['type ' ])) {
154+ $ configData = $ this ->applyNormalizer ($ defaultNormalizer , $ configData );
155+ }
149156 }
150157 }
151158
@@ -181,6 +188,14 @@ private function applyNormalizer(string $normalizerName, mixed $value)
181188 return $ this ->normalizerRegistry ->get ($ normalizerName )->normalize ($ value , $ this ->configManager ->getContextIdentifier ());
182189 }
183190
191+ private function getDefaultNormalizer (string $ type ): ?string
192+ {
193+ $ propertyNormalizerConfig = $ this ->configManager ->getConfig ('property_normalizer ' );
194+ $ defaultMapping = $ propertyNormalizerConfig ['default_type_mapping ' ];
195+
196+ return $ defaultMapping [$ type ] ?? null ;
197+ }
198+
184199 private function getBlockState (): BlockState
185200 {
186201 return $ this ->blockStateStack ->getCurrentState ();
0 commit comments