thiemowmde created this task.
thiemowmde added projects: WikibaseMediaInfo, Wikidata, 
Wikimedia-production-error.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  While working on a hot-fix for T259745: Uncaught ArgumentCountError: Too few 
arguments to function OOUI\Tag::appendContent(), 0 passed 
<https://phabricator.wikimedia.org/T259745> I realized the 
#wikimedia-production-error 
<https://phabricator.wikimedia.org/tag/wikimedia-production-error/> probably 
hints at //another// bug. This is the code that failed:
  
    $layout->appendContent(
        ...$this->getCaptionsContent(
                $entity->getLabels(),
                $this->getLanguagesOrderedByFallbackChain( $entity )
        )
    );
  
  Since appendContent() requires at least one argument, it fails when 
getCaptionsContent() returns an empty array. But wait, how is this possible? 
getLanguagesOrderedByFallbackChain() is documented to return at least the 
interface language. So it should be impossible that getCaptionsContent() 
returns nothing. How can the interface language get lost?
  
  The LanguageFallbackChain in question is created in 
WikibaseMediaInfoHooks::createEmptyStructuredData() 
<https://phabricator.wikimedia.org/diffusion/EWBI/browse/master/src/WikibaseMediaInfoHooks.php$521>
 with no $mode flag set, which means it should default to FALLBACK_ALL when 
LanguageFallbackChainFactory::newFromLanguage() 
<https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/lib/includes/LanguageFallbackChainFactory.php$67>
 is called. That //should// always include the original language in the result 
– but the code path is not obvious.
  
  I guess the task is to find out what's going on here, under which 
circumstances this LanguageFallbackChain can be empty, or add tracking code for 
this edge-case and monitor this potential bug further.

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

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

To: thiemowmde
Cc: Aklapper, hoo, liangent, brennen, Ammarpad, Umherirrender, Michael, Cparle, 
thiemowmde, Akuckartz, darthmon_wmde, Nandana, Lahi, Gq86, Pablo-WMDE, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Wikidata-bugs, aude, Ricordisamoa, Jdforrester-WMF, Mbch331, Rxy, Jay8g, Krenair
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to