Page MenuHomePhabricator

In the implementation editor, choosing "arg" in the mode selector empties the field completely and one must choose Argument reference as a type
Closed, ResolvedPublic

Description

Steps to reproduce:

{
	"Z1K1": "Z2",
	"Z2K1": {
		"Z1K1": "Z6",
		"Z6K1": "Z0"
	},
	"Z2K2": {
		"Z1K1": "Z8",
		"Z8K1": [
			"Z17",
			{
				"Z1K1": "Z17",
				"Z17K1": "Z40",
				"Z17K2": "Z0K1",
				"Z17K3": {
					"Z1K1": "Z12",
					"Z12K1": [
						"Z11",
						{
							"Z1K1": "Z11",
							"Z11K1": "Z1002",
							"Z11K2": "first input"
						}
					]
				}
			},
			{
				"Z1K1": "Z17",
				"Z17K1": "Z40",
				"Z17K2": "Z0K2",
				"Z17K3": {
					"Z1K1": "Z12",
					"Z12K1": [
						"Z11",
						{
							"Z1K1": "Z11",
							"Z11K1": "Z1002",
							"Z11K2": "second input"
						}
					]
				}
			}
		],
		"Z8K2": "Z40",
		"Z8K3": [ "Z20" ],
		"Z8K4": [ "Z14" ],
		"Z8K5": "Z0"
	},
	"Z2K3": {
		"Z1K1": "Z12",
		"Z12K1": [
			"Z11",
			{
				"Z1K1": "Z11",
				"Z11K1": "Z1002",
				"Z11K2": "And"
			}
		]
	}
}
  • Go to the createZObject special page: http://localhost:8080/wiki/Special:CreateZObject?view=zobject-editor
  • Under "Contents" select the type "Implementation"
  • Select the function "And"
  • In the composition gray box, select the function "If"
  • In "condition" select mode "arg"
  • To create an argument reference you must now select "Argument reference" on the type selector

Observed behavior:

  • When selecting function if, the value of Z14K2 is:
"Z14K2": {
    "Z1K1": "Z7",
    "Z7K1": "Z802",
    "Z802K1": {
        "Z1K1": "Z40",
        "Z40K1": ""
    }
  • When selecting "condition" mode "arg", the value of the Z14K2 is (condition disappears completely):
"Z14K2": {
    "Z1K1": "Z7",
    "Z7K1": "Z802"
}
  • When selecting "argument reference" on the type selector, the value of Z14K2 is the correct one:
"Z14K2": {
    "Z1K1": "Z7",
    "Z7K1": "Z802",
    "Z802K1": {
        "Z1K1": "Z18",
        "Z18K1": ""
    }
}

Expected behavior:

  • When selecting "condition" mode "arg", the key for condition Z802K1 should already be filled by a Z1K1: Z18 such as this:
"Z14K2": {
    "Z1K1": "Z7",
    "Z7K1": "Z802",
    "Z802K1": {
        "Z1K1": "Z18",
        "Z18K1": ""
    }
}

🤡Fun behavior🤡

  • Click on the trash bin next to the "If" function used in the composition
  • Start over again:
  • Search and select "If"
  • In the "condition" field, choose "arg" in the mode selector
  • IT WORKS!!
  • When reloading and starting from scratch, the behavior is unexpected, choosing "arg" clears the field. When removing the composition function and starting over again, it works as expected

Event Timeline

Jdforrester-WMF created this task.
Jdforrester-WMF renamed this task from In the implementation editor, you can't choose the argument in the drop down when creating compositions, if you've mis-numbered the arguments in the function declaration to In the implementation editor, you can't choose the argument in the drop down when creating compositions, as the arguments in the function declaration can get mis-numbered(?).Jul 20 2022, 12:36 PM
Jdforrester-WMF raised the priority of this task from Lowest to High.
gengh renamed this task from In the implementation editor, you can't choose the argument in the drop down when creating compositions, as the arguments in the function declaration can get mis-numbered(?) to In the implementation editor, choosing "arg" in the mode selector empties the field completely and one must choose Argument reference as a type.Jul 20 2022, 4:25 PM
gengh updated the task description. (Show Details)

I created a new system as of Monday morning, and now the "arg" option does not seem to exist at all.

Change 820703 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Fix fetchZKeys payload in changeType action

https://gerrit.wikimedia.org/r/820703

Change 820703 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Fix fetchZKeys payload in changeType action

https://gerrit.wikimedia.org/r/820703

Change 820741 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Fix fetchZkeys call payload in ZImplementation component

https://gerrit.wikimedia.org/r/820741

Change 820741 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Fix fetchZkeys call payload in ZImplementation component

https://gerrit.wikimedia.org/r/820741