This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 68d1ee2fe0 Fixed: Compound's single form are loaded as ModelGrid in
memory (OFBIZ-13330)
68d1ee2fe0 is described below
commit 68d1ee2fe0ed3dcc718a0a1810eab36bcf942f8b
Author: Nicolas Malin <[email protected]>
AuthorDate: Tue Dec 23 16:33:08 2025 +0100
Fixed: Compound's single form are loaded as ModelGrid in memory
(OFBIZ-13330)
If you create a simple single form in a compound, when OFBiz load it in
memory, the element create isn't a ModelForm but a ModelGrid.
This came from the object builder that analyze the XML tag name with the
name space. In FormFactory::createModelForm
*******
if ("form".equals(formElement.getTagName()) && ...)
{ return new ModelSingleForm( ...) }
return new ModelGrid( ...)
*******
Or : "wf:form" != "form"
Simple fix to remove the namespace from the analysis.
---
.../src/main/java/org/apache/ofbiz/widget/model/FormFactory.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FormFactory.java
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FormFactory.java
index 81ca151694..2987e3f16a 100644
---
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FormFactory.java
+++
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/FormFactory.java
@@ -159,7 +159,8 @@ public class FormFactory {
public static ModelForm createModelForm(Element formElement, ModelReader
entityModelReader, VisualTheme visualTheme,
DispatchContext dispatchContext,
String formLocation, String formName) {
String formType = formElement.getAttribute("type");
- if ("form".equals(formElement.getTagName()) && (formType.isEmpty() ||
"single".equals(formType) || "upload".equals(formType))) {
+ if ("form".equals(UtilXml.getTagNameIgnorePrefix(formElement))
+ && (formType.isEmpty() || "single".equals(formType) ||
"upload".equals(formType))) {
return new ModelSingleForm(formElement, formLocation,
entityModelReader, visualTheme, dispatchContext);
}
return new ModelGrid(formElement, formLocation, entityModelReader,
visualTheme, dispatchContext);