-
Bug
-
Resolution: Fixed
-
Major
-
4.3.8
-
None
I have a problem saving multiple categories while UTF8 support is enabled: Only the last category is persisted to the JCR. Even if multiple categories are selected. Without UTF8 all works as expected. This should also affect all form submits with multiple parameter values, e.g. multiselect lists with UTF8 enabled.
I debugged into magnolia and think that the problem is inside the UnicodeNormalizerRequestWrapper. When UTF8 support is activated, the request is additionaly wrapped by the UnicodeNormalizerRequestWrapper.
The save action of the CategorizationSaveHandler uses MgnlContext.getParameterValues(name) to retrieve the values that should be persisted. Finally, this calls this.request.getParameterValues(name).
Without UTF8 support this will end up in MultipartRequestWrapper.getParameterValues(name) which calls form.getParameterValues(name) which returns a list of all values for this name. So far, so good.
But, with UTF8 enabled the call to this.request.getParameterValues ends up in UnicodeNormalizerRequestWrapper.getParameterValues which gets the result from original.getParameterMap where original is the MultipartequestWrapper.getParameterMap which calls form.getParameter which only stores the last value of all categories that were send in the original request instead of a list of all values.
I think UnicodeNormalizerRequestWrapper.getParameterValues should also call original.getParameterValues instead of getParameterMap.
see info.magnolia.cms.filters.UnicodeNormalizationFilter:187