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

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new fdef6a24dd Fixed a bug where an error dialog appeared twice when the 
input stream was exception (#5956)
fdef6a24dd is described below

commit fdef6a24dd9cf2f3fc06fb28cf599d017408bcf7
Author: lance <[email protected]>
AuthorDate: Fri Nov 14 22:13:40 2025 +0800

    Fixed a bug where an error dialog appeared twice when the input stream was 
exception (#5956)
    
    Signed-off-by: lance <[email protected]>
---
 .../hop/pipeline/transforms/jsoninput/JsonInputDialog.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputDialog.java
 
b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputDialog.java
index 9f60faf1f3..0a170c9588 100644
--- 
a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputDialog.java
+++ 
b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputDialog.java
@@ -876,7 +876,9 @@ public class JsonInputDialog extends BaseTransformDialog {
     fdFieldValue.top = new FormAttachment(wlSourceField, 0, SWT.CENTER);
     fdFieldValue.right = new FormAttachment(100, -margin);
     wFieldValue.setLayoutData(fdFieldValue);
-    setSourceStreamField();
+
+    // Trigger event when 'Source is from a previous transform' is checked.
+    setSourceStreamField(false);
 
     FormData fdOutputField = new FormData();
     fdOutputField.left = new FormAttachment(0, margin);
@@ -1149,7 +1151,7 @@ public class JsonInputDialog extends BaseTransformDialog {
     // ///////////////////////////////////////////////////////////
   }
 
-  private void setSourceStreamField() {
+  private void setSourceStreamField(boolean isShowErrorDialog) {
     try {
       String value = wFieldValue.getText();
       wFieldValue.removeAll();
@@ -1162,6 +1164,10 @@ public class JsonInputDialog extends BaseTransformDialog 
{
         wFieldValue.setText(value);
       }
     } catch (HopException ke) {
+      if (!isShowErrorDialog) {
+        return;
+      }
+
       new ErrorDialog(
           shell,
           BaseMessages.getString(PKG, 
"JsonInputDialog.FailedToGetFields.DialogTitle"),
@@ -1339,7 +1345,9 @@ public class JsonInputDialog extends BaseTransformDialog {
         }
       }
     }
-    setSourceStreamField();
+
+    // Open the JSON input dialog and try to fetch the fields from the 
previous component.
+    setSourceStreamField(true);
 
     wFields.removeEmptyRows();
     wFields.setRowNums();

Reply via email to