Page MenuHomePhabricator

GoogleMaps extension is broken as of MediaWiki 1.19alpha
Closed, ResolvedPublic

Description

Author: carlb613

Description:
HTML output under MediaWiki 1.17alpha for GoogleMaps extension

[[mw;Extension:Google Maps]] appears to be breaking under MediaWiki 1.19 in an installation where it used to work under MediaWiki 1.17; the MW 1.19 output seems to be missing a long list of "div" tags and links to "transparent gif" files which were in both the GoogleMaps extension under MW 1.17 and in the MW 1.19 output for another extension, [[mw:Extension:Maps]].

Apparently the two extensions are not identical in functionality (GoogleMaps allowed users to create vector paths for display on the map, Maps did not) so I can't just substitute one for the other.

Affected site is currently MW 1.17 on http://mechelen.mapt.be and MW 1.19 on http://www.mapt.be until I find either a solution or a workaround.

The attached file contains the original (MediaWiki 1.17) output from this extension. That output is substantially longer (with links to a long list of "transparent gif" entries on Google's map site) than the following as the output of the extension under MediaWiki 1.19:

<center>
<div class="thumb tcenter" style="border: 1px solid silver;">
<div style="padding: 3px;">
<div id="map1" style="width: 525px; height: 400px; direction: ltr;">
<noscript>
<img alt="Map" height="400" width="525" src="http://maps.google.com/maps/api/staticmap?center=51.042257%2C4.470749&amp;zoom=13&amp;size=525x400&amp;key=ABQIAAAAEklKXT2gAMY9UkQEFLX_aRTwjjVbwzpqSNUGtxNhX9U-hCtnuxQPDQwcUmPKcWO3w2pAc22WtCGV4A&amp;language=nl&amp;sensor=false&amp;maptype=hybrid" />
</noscript>
<div id="map1_fallback" style="display: none;">
<img alt="Map" src="http://maps.google.com/maps/api/staticmap?center=51.042257%2C4.470749&amp;zoom=13&amp;size=525x400&amp;key=ABQIAAAAEklKXT2gAMY9UkQEFLX_aRTwjjVbwzpqSNUGtxNhX9U-hCtnuxQPDQwcUmPKcWO3w2pAc22WtCGV4A&amp;language=nl&amp;sensor=false&amp;maptype=hybrid" height="400" width="525">
</div>
</div>
<script type="text/javascript">
//
<![CDATA[

function makeMap1() {       if (!GBrowserIsCompatible()) {           document.getElementById("map1_fallback").style.display = '';           return;       }       var map = new GMap2(document.getElementById("map1"), { 'mapTypes': [G_NORMAL_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP, G_SATELLITE_MAP] });       GME_DEFAULT_ICON = G_DEFAULT_ICON;       map.setCenter(new GLatLng(51.042257, 4.470749), 13, G_HYBRID_MAP);       GEvent.addListener(map, 'click', function(overlay, point) {           if (overlay) {             if (overlay.tabs) {               overlay.openInfoWindowTabsHtml(overlay.tabs);             } elseif (overlay.title_link || overlay.caption || overlay.maxContent) {                 overlay.openInfoWindowHtml('

<div class="gmapinfowindow">'+ (overlay.title?('
<b>'+overlay.title_link+'
</b>
<br />'):'')+overlay.caption+'
</div>', { 'maxTitle': overlay.maxContent?overlay.title:undefined, 'maxContent': overlay.maxContent }); if (overlay.maxContent) { map.getInfoWindow().enableMaximize(); } else { map.getInfoWindow().disableMaximize(); } } } }); map.addControl(new GHierarchicalMapTypeControl()); map.addControl(new GSmallMapControl()); GME_DEFAULT_ICON = G_DEFAULT_ICON;} addLoadEvent(makeMap1);
//]]>

</script>

</div>
</div>
</center>


Version: unspecified
Severity: normal

Attached:

Details

Reference
bz30124

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:56 PM
bzimport set Reference to bz30124.

carlb613 wrote:

I tried the patch described on http://www.mediawiki.org/wiki/Extension_talk:Google_Maps#Map_does_not_show_up_in_MW_1.17.0 but it doesn't seem to help. There are no PHP warnings in the logs with the patch applied.

carlb613 wrote:

I tried grabbing the latest trunk/extensions/GoogleMaps and trunk/extensions/phase3 and I'm still seeing the extension working normally on MW 1.17alpha while *not* working at all on the latest MediaWiki 1.19alpha.

These two pages are both pointing to the same database, so I'm not sure where to look. The different MediaWiki version is the only obvious change...

MW 1.17a: http://mapt.be/wiki/Overleg:Hoofdpagina#3000_mijlpaal
MW 1.19a: http://www.mapt.be/wiki/Overleg:Hoofdpagina#3000_mijlpaal

I'm using the example provided on the [[mw:Extension:... page, which is:

<googlemap lat="32.82422" lon="48.481141">
32.81134, 48.498341, One of many [[gas stations]] in town
32.82448, 48.504848, The [[town hall]]
</googlemap>

The latest SVN version of MediaWiki 1.19alpha (r106599) gives just a blank, not a map. The same is true of any MW1.19a installation, as far as I can determine.

Sorry for re-closing this. I missed your comment for some reason.

The latest SVN version of MediaWiki 1.19alpha (r106599) gives just a blank, not
a map. The same is true of any MW1.19a installation, as far as I can determine.

With FireBug installed, I see the following (first of several) error:

"NetworkError: 404 Not Found - http://www.mapt.be/extensions/Maps/Services/GoogleMaps/GoogleMapFunctions.js?303-0.6.6%20alpha"

Which makes it look like something else is going on.

It sounds like you haven't run update.php after upgrading. What happens if you do that?

carlb613 wrote:

It looks like an 'svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Maps/Services' does not pick up a "GoogleMapFunctions.js" or anything else... not sure about this path. Is it created by alternate means, such as pre-existing from an old version of the extension or installed manually?

I do *not* have it on the MW 1.17a or 1.19alpha installs, but did find a copy from a previous install (likely 1.16) and copied that to the 'extensions' path as indicated - but with no change in the result. Still no map, that one 404 error is gone but the rest of this mess remains...

addOnloadHook is not defined <script>addOnloadHook(
Overle...dpagina (line 30)

addOnloadHook is not defined }</style><script>var timer_map_google_1;</script><script>addOnloadHook(
Overle...dpagina (line 81)

a is undefined td="closure_uid_"+Math.floor(Math.rand...turn a.call.apply(a.bind,arguments)},
main.js (line 121)

missing ; before statement
function makeMap1() { if (...EFAULT_ICON;} addLoadEvent(makeMap1);
Overle...dpagina (line 163)

JavaScript parse error: Parse error: Missing operand in file 'MediaWiki:Common.js' on line 213

I also tried the update.php "MediaWiki 1.19alpha updater" with no observed changes to the result.

(In reply to comment #6)

missing ; before statement
function makeMap1() { if (...EFAULT_ICON;} addLoadEvent(makeMap1);
Overle...dpagina (line 163)

I think this is the problem. You're missing this bit: r106549