Anomie added a subscriber: Anomie.
Anomie added a comment.

Unfortunately since it's fataling the request parameters don't make it into 
api.log. But I only see two things using OOUI\IconWidget: OOUI\FieldLayout, 
which would probably have run into the problem first before getting to the 
contained IconWidget, and WikidataPageBanner. Digging through that code, it 
looks like it's passing the IconWidget into OutputPage::setProperty, which 
leads me to this 
<https://en.wikivoyage.org/w/api.php?action=expandtemplates&title=Wisconsin&text={{PAGEBANNER:Example.png%7Cicon-x=Wisconsin}}&prop=properties>
 as a reproduction.

A large part of the problem is the interaction between `__call` and 
`is_callable`: ApiResult uses is_callable to try to determine whether the 
method exists before calling it, but is_callable apparently always returns true 
if __call exists. It doesn't use an interface, although one exists, so that 
extensions can maintain backwards compatibility.

The easiest solution may be to implement serializeForApiResult() on 
OOUI\Element or OOUI\Tag, probably to just return (string)$this. In this 
particular case, in the absence of the issue with `__call` and `is_callable` 
that's what ApiResult would do anyway since __toString() exists on the object.


TASK DETAIL
  https://phabricator.wikimedia.org/T111304

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Anomie
Cc: Anomie, Legoktm, Krenair, Jdforrester-WMF, Aklapper, mmodell, 
Wikidata-bugs, aude, jayvdb, Ricordisamoa, Lydia_Pintscher, Jay8g, greg, 
Malyacko



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to