Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Add missing form-name retrieval for auto-parameters-form (OFBIZ-12684) #872

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,20 @@ public Link(Element linkElement) {
}
Element autoFormParamsElement = UtilXml.firstChildElement(linkElement, "auto-parameters-form");
if (autoFormParamsElement != null) {
Node formElement = autoFormParamsElement;
while (formElement != null
&& formElement.getLocalName() != "form") {
formElement = formElement.getParentNode();
}
if (formElement != null && formElement.getLocalName() != null) {
parameterList.add(new Parameter("_FORM_NAME_", ((Element) formElement).getAttribute("name") + "_AS_PARAM_", false));
String formName = null;
if (autoFormParamsElement.hasAttribute("form-name") && autoFormParamsElement.getAttribute("form-name") != null) {
formName = autoFormParamsElement.getAttribute("form-name");
} else {
Node formElement = autoFormParamsElement;
while (formElement != null
&& formElement.getLocalName() != "form") {
formElement = formElement.getParentNode();
}
if (formElement != null && formElement.getLocalName() != null) {
formName = ((Element) formElement).getAttribute("name");
}
}
parameterList.add(new Parameter("_FORM_NAME_", formName + "_AS_PARAM_", false));
}
this.parameterList = Collections.unmodifiableList(parameterList);
Element autoServiceParamsElement = UtilXml.firstChildElement(linkElement, "auto-parameters-service");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2317,15 +2317,20 @@ public UpdateArea(Element updateAreaElement, String defaultServiceName, String d
}
Element autoFormParamsElement = UtilXml.firstChildElement(updateAreaElement, "auto-parameters-form");
if (autoFormParamsElement != null) {
Node formElement = autoFormParamsElement;
while (formElement != null
&& formElement.getLocalName() != "form") {
formElement = formElement.getParentNode();
}
if (formElement != null && formElement.getLocalName() != null) {
parameterList.add(new CommonWidgetModels.Parameter("_FORM_NAME_", ((Element) formElement).getAttribute("name") + "_AS_PARAM_",
false));
String formName = null;
if (autoFormParamsElement.hasAttribute("form-name") && autoFormParamsElement.getAttribute("form-name") != null) {
formName = autoFormParamsElement.getAttribute("form-name");
} else {
Node formElement = autoFormParamsElement;
while (formElement != null
&& formElement.getLocalName() != "form") {
formElement = formElement.getParentNode();
}
if (formElement != null && formElement.getLocalName() != null) {
formName = ((Element) formElement).getAttribute("name");
}
}
parameterList.add(new CommonWidgetModels.Parameter("_FORM_NAME_", formName + "_AS_PARAM_", false));
}
this.parameterList = Collections.unmodifiableList(parameterList);
Element autoServiceParamsElement = UtilXml.firstChildElement(updateAreaElement, "auto-parameters-service");
Expand Down
Loading