Ladsgroup added a comment.

  In T231084#5444984 <https://phabricator.wikimedia.org/T231084#5444984>, 
@Lucas_Werkmeister_WMDE wrote:
  
  > On the other hand, other content models sometimes seem to support this – 
this diff 
<https://www.mediawiki.org/w/index.php?oldid=3275990&diff=2484185&diffmode=source>,
 for example, is between a wikitext page and a JSON page. (It also works if you 
swap the compared revisions, for what it’s worth.)
  
  It's because JsonContent extends TextContent thus it passes the check while 
EntityContent doesn't (we can also make EntityContent extend it but it seems a 
little weird to me)
  
  In T231084#5569517 <https://phabricator.wikimedia.org/T231084#5569517>, 
@Umherirrender wrote:
  
  > Special:ComparePages makes it better 
https://www.wikidata.org/wiki/Special:ComparePages?page1=&rev1=11&page2=&rev2=772301402&action=&diffonly=&unhide=
  >
  >> Can not diff an entity with a non-entity content.
  >
  > wikibase-non-entity-diff
  > But not the other way round: 
https://www.wikidata.org/wiki/Special:ComparePages?page1=&rev1=772301402&page2=&rev2=11&action=&diffonly=&unhide=
  >
  >> [XaGZeQpAIC8AAHHLlKwAAAAI] 2019-10-12 09:14:33: Fatal 
„Wikimedia\Assert\ParameterTypeException“
  >
  > So the question seems which diffengine is instanced for the compare and 
what for checks it does
  
  The traceback for this fatal doesn't hit any part of Wikibase code, making it 
hard to fix:
  
    Backtrace:
    
    #0 /var/lib/mediawiki2/includes/diff/SlotDiffRenderer.php(86): 
Wikimedia\Assert\Assert::parameterType(string, Wikibase\ItemContent, string)
    #1 /var/lib/mediawiki2/includes/diff/TextSlotDiffRenderer.php(119): 
SlotDiffRenderer->normalizeContents(Wikibase\ItemContent, WikitextContent, 
string)
    #2 /var/lib/mediawiki2/includes/diff/DifferenceEngine.php(1137): 
TextSlotDiffRenderer->getDiff(Wikibase\ItemContent, WikitextContent)
    #3 /var/lib/mediawiki2/includes/diff/DifferenceEngine.php(1055): 
DifferenceEngine->getDiffBody()
    #4 /var/lib/mediawiki2/includes/diff/DifferenceEngine.php(1017): 
DifferenceEngine->getDiff(string, string, string)
    #5 /var/lib/mediawiki2/includes/diff/DifferenceEngine.php(781): 
DifferenceEngine->showDiff(string, string, string)
    #6 /var/lib/mediawiki2/includes/specials/SpecialComparePages.php(128): 
DifferenceEngine->showDiffPage(boolean)
    #7 /var/lib/mediawiki2/includes/htmlform/HTMLForm.php(694): 
SpecialComparePages::showDiff(array, OOUIHTMLForm)
    #8 /var/lib/mediawiki2/includes/specials/SpecialComparePages.php(109): 
HTMLForm->trySubmit()
    #9 /var/lib/mediawiki2/includes/specialpage/SpecialPage.php(575): 
SpecialComparePages->execute(NULL)
    #10 /var/lib/mediawiki2/includes/specialpage/SpecialPageFactory.php(611): 
SpecialPage->run(NULL)
    #11 /var/lib/mediawiki2/includes/MediaWiki.php(298): 
MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
    #12 /var/lib/mediawiki2/includes/MediaWiki.php(967): 
MediaWiki->performRequest()
    #13 /var/lib/mediawiki2/includes/MediaWiki.php(530): MediaWiki->main()
    #14 /var/lib/mediawiki2/index.php(46): MediaWiki->run()
    #15 {main}
  
  The main one is not super hard to fix though. I can put a try catch in 
ViewEntityAction::showEntityPage():
  
                try {
                        $this->page->view();
                } catch ( ParameterTypeException $exception ) {
                        if ( !$this->isDiff() === true ) {
                                throw $exception;
                        }
                }
  
  Not sure this is the best way to move forward. One other rather easy way is 
to have the try catch in DifferenceEngine::showDiffPage.

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

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

To: Ladsgroup
Cc: Umherirrender, Ladsgroup, Tgr, Michael, Lucas_Werkmeister_WMDE, Aklapper, 
darthmon_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, 
_jensen, rosalieper, Scott_WUaS, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, 
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