Page MenuHomePhabricator

Graph URLs all point to the first-defined link
Closed, ResolvedPublic

Description

With version 78f8598852813e3cbcbf2892c6690a48951afc3d URLs in graph nodes seem to be broken. I'm not sure if this is a problem with GraphViz or with its usage of the ImageMap extension; probably the former, as the imagemap coordinates appear to be correct, but just have the wrong link applied.

With a graph defined like this:

<graphviz>
digraph example {
  Mollusca [URL="[[w:Mollusca]]"];
  Neomeniomorpha [URL="[[w:Neomeniomorpha]]"];
  Mollusca->Neomeniomorpha
}
</graphviz>

The following results:

graph links.png (223×177 px, 9 KB)

Both of the links are to W:Mollusca. The tooltip above is shown where the cursor was above Neomeniomorpha.

The generated HTML is:

<map name="ImageMap_1_1084280109">
<area href="/wikimedia/mediawiki/index.php/W:Mollusca" shape="poly" coords="165,29,162,22,154,15,140,10,124,7,106,5,88,7,71,10,58,15,50,22,47,29,50,37,58,43,71,49,88,52,106,53,124,52,140,49,154,43,162,37" alt="W:Mollusca" title="W:Mollusca"/>
<area href="/wikimedia/mediawiki/index.php/W:Mollusca" shape="poly" coords="206,125,201,118,187,111,165,106,137,103,106,101,75,103,47,106,25,111,10,118,5,125,10,133,25,139,47,145,75,148,106,149,137,148,165,145,187,139,201,133" alt="W:Mollusca" title="W:Mollusca"/>
</map>
<img alt="This is a graph with borders and nodes that may contain hyperlinks." src="/wikimedia/mediawiki/images/6/66/Main_Page_digraph_example_dot.png" width="212" height="155" usemap="#ImageMap_1_1084280109"/>

Event Timeline

  • MediaWiki 1.28.1 (819c0d2) 00:51, 7. Apr. 2017
  • PHP 5.6.30-0+deb8u1 (apache2handler)
  • MariaDB 10.0.30-MariaDB-1~jessie
  • Graphviz 2.0.0 (78f8598) 20:50, 10. Apr. 2017

I am using this in combination with Semantic MediaWiki:

{{#ask:
 [[Process::Mise en place d'un wiki]]
 |?oui
 |?non
 |?has Successor=
 |?Responsable
 |format=graph
 |nodeshape=rectangle
 |graphsize=20,20
 |graphcolor=yes
 |graphlink=yes
 |graphlabel=yes
 |graphlegend=yes
 |arrowdirection=TB
}}

Here the link always goes to the last element found. This is however just a variation to what Sam reported. See this page for the live example.

This is a regression since it worked with Graphviz 1.6.1 (dbfa827) 22:13, 9. Mai 2016

When I comment-out the code added in T151294, this problem goes away.

Change 348522 had a related patch set uploaded (by Welterkj):
[mediawiki/extensions/GraphViz@master] Re-write the fix for T151294 which caused all graph links to be the same.

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

@Samwilson, please review the change. If you could also confirm that it still satisfies your T151294 test case (but with multiple links) that would be great. Thanks.

@Welterkj that patch works correctly in all situations I've been testing in. Thanks for such speedy work!

@Welterkj that patch works correctly in all situations I've been testing in. Thanks for such speedy work!

Same here. Great! Thanks a lot!

Kghbln triaged this task as High priority.
Kghbln awarded a token.

@Welterkj don't forget to merge that patch :)

+1 ... and tag. Cannot wait for all the coolness. :)

Change 348522 merged by jenkins-bot:
[mediawiki/extensions/GraphViz@master] Re-write the fix for T151294 which caused all graph links to be the same.

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