Page MenuHomePhabricator

Why are images not in the filelist after patching Graphiz MediaWiki extension?
Open, Needs TriagePublic

Description

On a Mediawiki 1.33 i have patched the graphviz extension as outlined in https://github.com/WolfgangFahl/mediawiki-extensions-GraphViz/commit/f3cfc18

Now the images appear in the image table:

select img_name from image;
+----------------------------------+
| img_name                         |
+----------------------------------+
| GraphViz_graph_rq_dot.svg        |
| GraphViz_graph_graphname_dot.svg |

but not in the filelist and the ImageMap extension complains as shown in https://phabricator.wikimedia.org/T244720

What is the reason for this behavior? Where is the proper use of the Image table documented?

What would be a simpler alternative to the complicated code in https://github.com/WolfgangFahl/mediawiki-extensions-GraphViz/blob/master/includes/UploadLocalFile.php?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 10 2020, 1:49 PM

What is the "filelist"? A clear list of steps to reproduce would be welcome.

Where is the proper use of the Image table documented?

What is "improper use"? Please allow others to better understand any issue by providing a clear list of steps. (Also note that Phabricator is not a support forum, but for bug reports and feature requests. Thanks.)

Seppl2013 added a comment.EditedFeb 10 2020, 2:54 PM

The Special:ListFiles ist called "File List" in Special:SpecialPages
it contains


With the mediawiki graphviz extension installed a page with the content below:

<graphviz format='png'>
graph rq2 { 
  Stakeholder -- Requirements; 
  Requirements -- Samplecases;
  Requirements -- Model;
  Model -- Code;
}
</graphviz>

will have a GraphViz_graph_rq_dot.svg be created by running the dot command. The resulting svg file should now be presented as a map. With 1.27 this still used to work see http://wiki.bitplan.com/index.php/GraphViz. With 1.33 it does not for the change ins the image database table. The workaround should make sure that this change does not effect the basic workings and it was reported that someone hat success with this in https://www.mediawiki.org/wiki/Topic:V2cf1hrkrjb8i2ub. I tried things out in a debugging environment today with a clean Mediawiki install in a virtual ubuntu 18.04 LTS machine see http://wiki.bitplan.com/index.php/PHP_Mediawiki_Eclipse_debugging#Environment.

The files exist:

find . | grep _rq
./d/d2/GraphViz_graph_rq_dot.svg
./graphviz/GraphViz_graph_rq2.src
./2/2c/GraphViz_graph_rq_dot.png
./c/c9/GraphViz_graph_rq2_dot.png

and the content is o.k e.g.
wiki/images//d/d2/GraphViz_graph_rq_dot.svg
has


source code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
 -->
<!-- Title: rq Pages: 1 -->
<svg width="206pt" height="260pt"
 viewBox="0.00 0.00 206.34 260.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 256)">
<title>rq</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-256 202.342,-256 202.342,4 -4,4"/>
<!-- Stakeholder -->
<g id="node1" class="node">
<title>Stakeholder</title>
<ellipse fill="none" stroke="#000000" cx="109.895" cy="-234" rx="52.7911" ry="18"/>
<text text-anchor="middle" x="109.895" y="-230.3" font-family="Times,serif" font-size="14.00" fill="#000000">Stakeholder</text>
</g>
<!-- Requirements -->
<g id="node2" class="node">
<title>Requirements</title>
<ellipse fill="none" stroke="#000000" cx="109.895" cy="-162" rx="59.5901" ry="18"/>
<text text-anchor="middle" x="109.895" y="-158.3" font-family="Times,serif" font-size="14.00" fill="#000000">Requirements</text>
</g>
<!-- Stakeholder&#45;&#45;Requirements -->
<g id="edge1" class="edge">
<title>Stakeholder&#45;&#45;Requirements</title>
<path fill="none" stroke="#000000" d="M109.895,-215.8314C109.895,-205 109.895,-191.2876 109.895,-180.4133"/>
</g>
<!-- Samplecases -->
<g id="node3" class="node">
<title>Samplecases</title>
<ellipse fill="none" stroke="#000000" cx="55.895" cy="-90" rx="55.7903" ry="18"/>
<text text-anchor="middle" x="55.895" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Samplecases</text>
</g>
<!-- Requirements&#45;&#45;Samplecases -->
<g id="edge2" class="edge">
<title>Requirements&#45;&#45;Samplecases</title>
<path fill="none" stroke="#000000" d="M96.5467,-144.2022C88.1765,-133.0419 77.4308,-118.7143 69.0898,-107.593"/>
</g>
<!-- Model -->
<g id="node4" class="node">
<title>Model</title>
<ellipse fill="none" stroke="#000000" cx="163.895" cy="-90" rx="34.394" ry="18"/>
<text text-anchor="middle" x="163.895" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Model</text>
</g>
<!-- Requirements&#45;&#45;Model -->
<g id="edge3" class="edge">
<title>Requirements&#45;&#45;Model</title>
<path fill="none" stroke="#000000" d="M123.2434,-144.2022C131.7385,-132.8753 142.6806,-118.2859 151.0721,-107.0972"/>
</g>
<!-- Code -->
<g id="node5" class="node">
<title>Code</title>
<ellipse fill="none" stroke="#000000" cx="163.895" cy="-18" rx="29.4969" ry="18"/>
<text text-anchor="middle" x="163.895" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">Code</text>
</g>
<!-- Model&#45;&#45;Code -->
<g id="edge4" class="edge">
<title>Model&#45;&#45;Code</title>
<path fill="none" stroke="#000000" d="M163.895,-71.8314C163.895,-61 163.895,-47.2876 163.895,-36.4133"/>
</g>
</g>
</svg>

What other details would be needed for explanation?

a valid workaround seems to be

alter table image add img_description varchar(255);
alter table oldimage add oi_description varchar(255);

So readding the columns would help.

The workaround is not consistently helping. I have a 1.33 wiki where it works see http://ebike.bitplan.com/index.php/GraphViz#Graph and others where it does not see http://royal-family.bitplan.com/index.php/GraphViz#Graph. The two wikis are in the same wiki family and share the same extensions ... so it must be some difference in the settings, permissions or other subtle detail that is effecting the behavior.