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 bc19632c86 Fixed: Duplication of JWT send to the request on modal
stepper (#2092)
bc19632c86 is described below
commit bc19632c867d6b0a570a22a7f4a819c3acba9c61
Author: Nicolas Malin <[email protected]>
AuthorDate: Mon Sep 28 09:29:51 2026 +0200
Fixed: Duplication of JWT send to the request on modal stepper (#2092)
When you start a modal stepper to realize multiple edition, you start by
initialize a set-callback that set a JWT_CALLBACK in your context.
At the first step, the first form grab the JWT_CALLBACK to propagate it,
with information on submit propagate-callback. The second step, the form
grab also the JWT_CALLBACK and also deploy it. This creates a
duplication when you submit the form and your request contains a list of
JWT_CALLBACK
To escape this case, when we create the dynamic link, if form's field
will be sent by this like, we remove a potential JWT_CALLBACK on
parameters to keep only that one present in form
---
.../main/java/org/apache/ofbiz/widget/model/CommonWidgetModels.java | 3 ---
.../org/apache/ofbiz/widget/renderer/macro/MacroCommonRenderer.java | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/CommonWidgetModels.java
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/CommonWidgetModels.java
index 698434ce1e..7c1177438d 100644
---
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/CommonWidgetModels.java
+++
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/CommonWidgetModels.java
@@ -793,9 +793,6 @@ public final class CommonWidgetModels {
ModelForm.UpdateArea callBack) {
Map<String, Object> fullParameterMap = new HashMap<String, Object>();
- // If the parameter contains the map, the call back will be
automatically manage by the form
- if (fullParameterMap.containsKey("_FORM_NAME_")) return
fullParameterMap;
-
String currentJwtCallback = WidgetWorker.getJwtCallback(context);
if (callBack != null && propagateMyCallback) {
fullParameterMap.put(JWT_CALLBACK, callBack.toJwtToken(context));
diff --git
a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroCommonRenderer.java
b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroCommonRenderer.java
index 252f079538..0e0c4c6969 100644
---
a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroCommonRenderer.java
+++
b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroCommonRenderer.java
@@ -90,6 +90,9 @@ public class MacroCommonRenderer {
parameters.putAll(UtilGenerics.cast(extraParams));
}
parameters.putAll(UtilGenerics.cast(updateArea.getParameterMap(ctx)));
+ if (parameters.containsKey("_FORM_NAME_")) {
+ parameters.remove("JWT_CALLBACK");
+ }
UtilHttp.canonicalizeParameterMap(parameters);
parametersToForward = UtilHttp.urlEncodeArgs(parameters, false);