Page MenuHomePhabricator

Cannot create an instance of Z8/Function
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. Go to https://notwikilambda.toolforge.org/wiki/Special:CreateZObject
  2. Create an instance of Z8/Function

Screenshot 2021-03-05 at 17.18.50.png (831×785 px, 109 KB)

{ "Z1K1": "Z2", "Z2K1": "Z801", "Z2K3": { "Z1K1": "Z12", "Z12K1": [ { "Z1K1": "Z11", "Z11K1": "en", "Z11K2": "test function" } ] }, "Z2K2": { "Z1K1": "Z8", "Z8K1": [], "Z8K2": { "Z1K1": "Z9", "Z9K1": "Z6" }, "Z8K3": [], "Z8K4": [], "Z8K5": { "Z1K1": "Z6", "Z6K1": "Z801" } } }

  1. Click "Save"

Actual Results:
Receives a wikilambda-invalidzobject error

Expected Results:
Save the Function

I didn't get to the bottom of this yet, why it fails.

Related Objects

Event Timeline

I see the same problem. Looking into it now!

I'm assuming this is the same issue as T276836: Cannot edit Z4/Type, and that the recent changes to the normalisation code in the front-end API means the operations made clientside are no longer valid?

I'm assuming this is the same issue as T276836: Cannot edit Z4/Type, and that the recent changes to the normalisation code in the front-end API means the operations made clientside are no longer valid?

There is probably some overlap, but what I'm running into are mainly issues very specific to an on-wiki type (Z8) vs built-in types. Several things I've hit so far:

  • Z10 is the key type being validated (for Z8K1 etc), as opposed to "Array"
  • empty arrays were validating as false despite being actual arrays
  • validating a type (Z4 for Z8K2) doesn't know how to deal with a reference to a type

Change 673073 had a related patch set uploaded (by ArthurPSmith; owner: ArthurPSmith):
[mediawiki/extensions/WikiLambda@master] Handle validation for in-wiki types with list and type-valued keys

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

@Jdforrester-WMF the patch I just uploaded does also fix T276836: Cannot edit Z4/Type - the issue there was indeed the change in normalization. I'm not sure however if my fix for that (denormalizing strings and references in the key validation check) is ideal... but it does seem to work. I added tests that fail without these changes and pass now.

Change 673073 merged by jenkins-bot:
[mediawiki/extensions/WikiLambda@master] ZObjectFactory: Validate in-wiki types with list or type-valued keys

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