Page MenuHomePhabricator

Bad "allows values" statement gets processed (at least somewhat)
Closed, ResolvedPublic

Description

MW 1.36.2 Cargo 3.0 (5decb5b) 2021-12-09T10:06:57

I started troubleshooting because the Cargo table diagram was coming up blank (see T297455) . When I did an inspect on it, it showed me the following:

Section":{"mType":"Page","mSize":null,"mDependentOn":[],"mIsList":false,"mAllowedValues":["" \"`uniq--item-13592--qinu`\"'"],"mismandatory":false,"misunique":false,"mregex":null,"mishidden

One problem was that I tried to populate the allowed values for the section field with the output of another Cargo query (and a broken one at that). Obviously my bad for putting nasty code like that.

But since I was in there already I figured, what if I give it some other bad entry for allowed values? So I tried

(allowed values=a,b,

ie no ending bracket.

When I recreated the table it showed this as

Section - Page (allowed values=a,b

but no error or hint that something is wrong. The closest thing that may be a hint was that the recreate table wasn't actually working, it almost looked like it had but nothing had changed. I had to run the cargoRecreateData script to recreate the table.

When I remove the bad allowed... statement, the recreate data from page still doesn't work, I still have to run it from .php script. So maybe that part isn't even related and there is some other problem...

In any case... the original problem attempting to use a cargo query to set the allowed value caused Cargo Table Diagram to just list as blank, so bad values in allowed values should probably be trapped and given a clear error.

Event Timeline

Change 768953 had a related patch set uploaded (by Techwizzie; author: Techwizzie):

[mediawiki/extensions/Cargo@master] Fix for invalid paranthesis

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

Change 768953 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] Fix for invalid parentheses

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

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

I believe this is fixed now...