Page MenuHomePhabricator

Reference marked as missing but successfully adapted
Closed, ResolvedPublic

Description

Content translation displays references in grey when they are empty (T203160) or have some mandatory parameters missing (T206310).

However, some templates are currently shown in grey despite being properly adapted and missing no mandatory parameter. We should avoid this since it generates confusion.

This quick link shows an example illustrated below (see published result):

Reference adapted in grey showing a warning about the reference being missingExploration shows contents were copied for several parameters including the only mandatory one
Screenshot 2019-06-13 at 13.54.40.png (613×1 px, 124 KB)
Screenshot 2019-06-13 at 13.59.02.png (673×1 px, 84 KB)

Note that the issue does not happen if the source content does not include the References section with the {{Listaref|33em}} element. That is, the issue was not happening for this initial revision of the content.

Event Timeline

How different is this ticket from what was reported in T203160#5215204?

How different is this ticket from what was reported in T203160#5215204?

The issues is the same, but I think it deserves it's own ticket. In this area we have:

  • T203160 Mark unadapted templates in grey and skip publishing them (last part still missing)
  • T225716 (this ticket). Don't mark in grey those that were well adapted.
  • T224437 Show the correct warning depending on whether the template was incomplete or missing.

They are related but each cover a different case. I hope this provides some clarity, but feel free to ask for further details or propose any other organization that makes it easy to solve them.

Pginer-WMF raised the priority of this task from Medium to High.Jul 16 2019, 7:59 AM

Change 524204 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] MWReference: Correct the way adaptation status is calculated

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

Analysis:
The reference content is a template:

<div>
<span about="#mwt5" class="citation libro"
    data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Cita  libro&quot;,&quot;href&quot;:&quot;./Plantilla:Cita_libro&quot;},&quot;params&quot;:{&quot;autor&quot;:{&quot;wt&quot;:&quot;Frisancho  AR&quot;},&quot;título&quot;:{&quot;wt&quot;:&quot;Human  Adaptation  and  Accommodation&quot;},&quot;año&quot;:{&quot;wt&quot;:&quot;1993&quot;},&quot;url&quot;:{&quot;wt&quot;:&quot;https://books.google.com/books?id=-K_SYHBo42MC&amp;pg&quot;},&quot;páginas&quot;:{&quot;wt&quot;:&quot;175–301&quot;},&quot;isbn&quot;:{&quot;wt&quot;:&quot;0472095110&quot;},&quot;editorial&quot;:{&quot;wt&quot;:&quot;University  of  Michigan  Press&quot;}},&quot;i&quot;:0}}]}"
    id="CITAREFFrisancho_AR1993"
    typeof="mw:Transclusion"
    data-ve-no-generated-contents="true">
    Frisancho AR (1993).
    <a
        class="external text"
        href="https://books.google.com/books?id=-K_SYHBo42MC&amp;pg"
        id="mwAd8"
        rel="mw:ExtLink">
        <i id="mwAeA">Human Adaptation and Accommodation</i>
    </a>. University of Michigan Press. pp. <span id="mwAeE" typeof="mw:Entity">&nbsp;</span> 175-301.
    <small id="mwAeI">
        <a class="cx-link" data-linkid="197" href="./ISBN" id="mwAeM" rel="mw:WikiLink" title="ISBN">ISBN</a>
        <span id="mwAeQ" typeof="mw:Entity">&nbsp;</span>
        <a
            class="cx-link"
            data-linkid="198"
            href="./Especial:FuentesDeLibros/0472095110" id="mwAeU" rel="mw:WikiLink"
            title="Especial:FuentesDeLibros/0472095110">0472095110</a>
    </small>.
</span>
<span about="#mwt5" class="Z3988"
    id="mwAeY"
    title="ctx_ver=Z39.88-2004&amp;rfr_id=info%3Asid%2Fes.wikipedia.org%3AAnimales  de  gran  altitud&amp;rft.au=Frisancho  AR&amp;rft.aulast=Frisancho  AR&amp;rft.btitle=Human  Adaptation  and  Accommodation&amp;rft.date=1993&amp;rft.genre=book&amp;rft.isbn=0472095110&amp;rft.pages=175-301&amp;rft.pub=University  of  Michigan  Press&amp;rft_id=https%3A%2F%2Fbooks.google.com%2Fbooks%3Fid%3D-K_SYHBo42MC%26pg&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook"
    data-ve-ignore="true">
    <span id="mwAec" style="display:none;"><span id="mwAeg" typeof="mw:Entity">&nbsp;</span></span>
</span>
</div>

While recursively adapting contents, the Especial:FuentesDeLibros/0472095110 MWLink adaptation result was false.

While recursively adapting contents, the Especial:FuentesDeLibros/0472095110 MWLink adaptation result was false.

I'm not sure I completely understand this. So the failure of one part was propagated to consider the whole adaptation was not perfect?
For the current ticket we are focusing on cases where the adaptation (a) fails completely (source template has parameters, but the target is completely empty) or (b) where the target template has mandatory parameters being empty.

So the following cases should be rendered normally in blue (*not* in gery):

  • Source template is empty (template with no parameters) and generates an empty template in the translation.
  • Source template has parameters with information and generates a template with some parameters filled and others missing (none of these marked as mandatory).

I hope this helps for check the different cases when developing and testing.

@Pginer-WMF, to clarify, I was writing down, the root cause, not the expected behavior. I have fixed the issue in the patch linked.

Change 524204 merged by jenkins-bot:
[mediawiki/services/cxserver@master] MWReference: Correct the way adaptation status is calculated

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

I tested this on cx2-testing and the warning no longer shows (EXPECTED).

One thing I noticed was that after the article is published, the reference is empty, is this due to it not existing on cx2?

One thing I noticed was that after the article is published, the reference is empty, is this due to it not existing on cx2?

Yes. If you look at the published wikitext, the information is there:

{{Ref-llibre|cognom=Frisancho AR|títol=Human Adaptation and Accommodation|any=1993|url=https://books.google.com/books?id=-K_SYHBo42MC&pg|pàgines=175–301|isbn=0472095110|editorial=University of Michigan Press}}

However, the Ref-llibre template is not available in the CX2 test instance, so the rendered article just shows the template name in red (which is the way to represent a template not available).

If you copy the generated wikitext to Catalan Wikipedia, where the template is available (e.g., in your sandbox there), the content should render as expected.

If you copy the generated wikitext to Catalan Wikipedia, where the template is available (e.g., in your sandbox there), the content should render as expected.

nice trick, thanks!