Page MenuHomePhabricator

User-created type is not being displayed
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • I created a new type with two keys, both of type String
  • I saved the new type
  • I go to view the new type

What happens?:
It just shows the name of the Type, the ZID, that it is a type, and then "Loading data", but it never changes.

In the console, the following warnings appear (not sure if that is related):

jQuery.Deferred exception: keys.forEach is not a function TypeError: keys.forEach is not a function
    at http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:46:341
    at Array.forEach (<anonymous>)
    at http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:45:520
    at mightThrow (http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:1518:881)
    at process (http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:1519:544) undefined
jQuery.Deferred.exceptionHook @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1521
process @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1519
setTimeout (async)
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1519
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
deferred.<computed> @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1520
(anonymous) @ VM76:45
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
done @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1599
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1603
load (async)
send @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1603
ajax @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1598
ajax @ VM76:44
get @ VM76:43
performZKeyFetch @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:45
(anonymous) @ VM76:19
a.dispatch @ VM76:21
dispatch @ VM76:17
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:44
setTimeout (async)
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:44
fetchZKeys @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:44
(anonymous) @ VM76:19
a.dispatch @ VM76:21
dispatch @ VM76:17
initialize @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:8
(anonymous) @ VM76:19
a.dispatch @ VM76:21
dispatch @ VM76:17
n.<computed> @ VM76:23
created @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:73
Us @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1687
Hs @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1687
oo @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1644
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1685
Ps @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1685
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1683
ks @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1683
M @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1659
P @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1659
m @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1656
Q @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1666
mount @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1652
t.mount @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1709
ext.wikilambda.edit/index.js @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1
runScript @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:12
(anonymous) @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:13
flushCssBuffer @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:4
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:5
execute @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:13
doPropagation @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:6
requestIdleCallback (async)
setAndPropagate @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:7
implement @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:18
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1
load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1521 jQuery.Deferred exception: keys.forEach is not a function TypeError: keys.forEach is not a function
    at http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:46:341
    at Array.forEach (<anonymous>)
    at http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:45:520
    at mightThrow (http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:1518:881)
    at process (http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:1519:544) undefined
jQuery.Deferred.exceptionHook @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1521
process @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1519
setTimeout (async)
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1519
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
process @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1519
setTimeout (async)
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1519
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
deferred.<computed> @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1520
(anonymous) @ VM76:45
fire @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1515
fireWith @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1517
done @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1599
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1603
load (async)
send @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1603
ajax @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1598
ajax @ VM76:44
get @ VM76:43
performZKeyFetch @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:45
(anonymous) @ VM76:19
a.dispatch @ VM76:21
dispatch @ VM76:17
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:44
setTimeout (async)
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:44
fetchZKeys @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:44
(anonymous) @ VM76:19
a.dispatch @ VM76:21
dispatch @ VM76:17
initialize @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:8
(anonymous) @ VM76:19
a.dispatch @ VM76:21
dispatch @ VM76:17
n.<computed> @ VM76:23
created @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:73
Us @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1687
Hs @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1687
oo @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1644
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1685
Ps @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1685
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1683
ks @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1683
M @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1659
P @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1659
m @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1656
Q @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1666
mount @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1652
t.mount @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1709
ext.wikilambda.edit/index.js @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1
runScript @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:12
(anonymous) @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:13
flushCssBuffer @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:4
requestAnimationFrame (async)
addEmbeddedCSS @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:5
execute @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:13
doPropagation @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:6
requestIdleCallback (async)
setAndPropagate @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:7
implement @ load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:18
(anonymous) @ load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1
load.php?lang=en&modules=ext.wikilambda.edit|jquery%2Cvue&skin=vector&version=s7o82:1521 jQuery.Deferred exception: keys.forEach is not a function TypeError: keys.forEach is not a function
    at http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:46:341
    at Array.forEach (<anonymous>)
    at http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:45:520
    at mightThrow (http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:1518:881)
    at process (http://localhost:8080/w/load.php?lang=en&modules=ext.wikilambda.edit%7Cjquery%2Cvue&skin=vector&version=s7o82:1519:544) undefined

What should have happened instead?:
The type should have been loaded and displayed.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
New wiki as of January 13.

Event Timeline

This comment was removed by DVrandecic.
This comment was removed by DVrandecic.

I see now that old types still work. The issue is in the encoding of the type.

The new type has a Z881(Z3) as the value of the Z4K2, the old type had a JSON array. So this is how it looks now, and that doesn't work for the front end:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10165"
    },
    "Z2K2": {
        "Z1K1": "Z4",
        "Z4K1": "Z10165",
        "Z4K2": {
            "Z1K1": {
                "Z1K1": "Z7",
                "Z7K1": "Z881",
                "Z881K1": "Z3"
            },
            "K1": {
                "Z1K1": "Z3",
                "Z3K1": "Z6",
                "Z3K2": "K1",
                "Z3K3": {
                    "Z1K1": "Z12",
                    "Z12K1": [
                        {
                            "Z1K1": "Z11",
                            "Z11K1": "Z1002",
                            "Z11K2": "first"
                        }
                    ]
                }
            },
            "K2": {
                "Z1K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z881",
                    "Z881K1": "Z3"
                },
                "K1": {
                    "Z1K1": "Z3",
                    "Z3K1": "Z6",
                    "Z3K2": "K2",
                    "Z3K3": {
                        "Z1K1": "Z12",
                        "Z12K1": [
                            {
                                "Z1K1": "Z11",
                                "Z11K1": "Z1002",
                                "Z11K2": "second"
                            }
                        ]
                    }
                },
                "K2": {
                    "Z1K1": {
                        "Z1K1": "Z7",
                        "Z7K1": "Z881",
                        "Z881K1": "Z3"
                    }
                }
            }
        },
        "Z4K3": "Z101"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Vector of two strings"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

Just to provide further context to complete the task. After the introduction of Typed list, the argument of a type are NOT a simple array anymore but follow the structure of a typed list. This is breaking the current logic that expect an array and it is not able to read through the deep nested structure of a typed list.

To fix this issue the following action need to happen:

  • Create an helper function in the function-schemata to turn a typed list into a normal array (so that it resemble the old structure)
  • Add logic in the performZKeyFetch to check the TYPE of the keys object (there are existing methods and helpers to do so)
  • Use the above defined helper to convert the keys to an array