Page MenuHomePhabricator

Invalid prop type for <select> component
Closed, ResolvedPublicBUG REPORT

Description

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

  • Go to Special:MediaSearch on Commons and set debug=true in the URL params
  • Open the browser console and check for errors

What happens?:
Every <SdSelect> component (the dropdown menus in the filter bar) will complain about invalid props:

[Vue warn]: Invalid prop: type check failed for prop "label". Expected String with value "Community Assessments", got Object 

found in

---> <SdSelect>
       <SearchFilters>
         <SdTab>
           <SdTabs>
             <MediaSearch>
               <Root>

Functionality is not impacted.

What should have happened instead?:
This component should be receiving props which match the expected values.


This change is a consequence of the patch that fixed T285349. We are now passing in a label value (we weren't doing this before) as part of the behavior change specified in that patch.

The component expects Strings; we are passing in Message objects that resolve to strings. The fact that the object's toString behavior provides what we want is why this error has no user-facing impact. It should still be fixed ASAP.

Event Timeline

Change 726147 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/extensions/MediaSearch@master] Allow mw.Message objects as \"label\" props for Select component

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

Change 726147 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] Allow mw.Message objects as \"label\" props for Select component

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

@Seddon - I checked on commons wmf.5 and I still see the warnings when I'm logged in (e.g. https://commons.wikimedia.org/w/index.php?title=Special:MediaSearch&search=train&go=Go&type=image&debug=true). I do not see the warnings if I'm not logged in.
commons betalabs doesn't show the warnings. Is it expected?

An example of the warning on commons wmf.5 when logged in:

vue_warnings
Vue warn]: Invalid prop: type check failed for prop "label". Expected String with value "License", got Object 

found in

---> <SdSelect>
       <SearchFilters>
         <SdTab>
           <SdTabs>
             <MediaSearch>
               <Root> load.php:14380:15
    jQuery 93
    runScript https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1372
    execute https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1485
    doPropagation https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:862
    (Async: requestIdleCallback handler)
    setAndPropagate https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:935
    markModuleReady https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1331
    nestedAddScript https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1338
    nestedAddScript https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1343
    queueModuleScript https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1197
    onerror https://commons.wikimedia.org/w/load.php?debug=1&lang=en&modules=startup&only=scripts&raw=1&skin=vector:1168
Etonkovidova claimed this task.
Etonkovidova added a subscriber: SimoneThisDot.

Thanks to @SimoneThisDot suggestions, I re-checked the issue on Chrome and FF has (for the same user), and FF required manual clearing cookies/site data. Chrome did not display the issue. Closing the task as Resolved.