This is an automated email from the ASF dual-hosted git repository.

nmalin pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit 75862c3ef625f1752a14fe150a4984d461b7510a
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 1fc0a9c8f9..d435432040 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);

Reply via email to