Last modified: 2010-06-09 12:44:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25849, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23849 - Undefined index: original-value in Validator class
Undefined index: original-value in Validator class
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticMaps (Other open bugs)
unspecified
All All
: Normal blocker (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-08 19:33 UTC by Laurent Alquier
Modified: 2010-06-09 12:44 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Laurent Alquier 2010-06-08 19:33:09 UTC
After updating to 0.6.2, I am getting this error on a form with a field of type 'coordinates'.

Notice: Undefined index: original-value in C:\Data\htdocs\smw\extensions\Validator\Validator.class.php  on line 228

This results in an empty map and a non-responsive 'Lookup coordinates' form.

I am using Yahoo both for maps and geocoding service.
I updated the database correctly (maps and semantic maps are displaying normally).

My Coordinates field looks like :

{{{field|Coordinates|input type=yahoomaps|zoom=10}}}

Any idea what could be going on ?
Comment 1 Laurent Alquier 2010-06-08 20:19:36 UTC
Looking at the source code of the page, it looks like the form page is missing calls to the Yahoo API.

Here is what is generated on the page :

<script src="/smw/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFunctions.js?118-0.6.2&amp;118"></script>
<script>/*<![CDATA[*/
function convertLatToDMS (val) {
	return Math.abs(val) + "° " + ( val < 0 ? "S" : "N" );
}
function convertLngToDMS (val) {
	return Math.abs(val) + "° " + ( val < 0 ? "W" : "E" );
}
/*]]>*/</script>
<script>
addOnloadHook(
	function() {
		makeFormInputYahooMap(
			'map_yahoo_1',
			'map_yahoo_coords_1_6',
			null,
			null,
			17,
			YAHOO_MAP_REG,
			[YAHOO_MAP_REG,YAHOO_MAP_SAT,YAHOO_MAP_HYB],
			['type','pan','zoom'],
			true,
			null,
			null
		);
	}
);
</script>

This throws a javascript error about YAHOO_MAP_REG being undefined.
Comment 2 Laurent Alquier 2010-06-08 20:53:58 UTC
Same behavior with Openlayers.  The scripts are reduced to a single URL instead of multiple scripts.

It looks like the code used to generate the form input is missing calls to set calls to the API sripts for whatever service is used.
Comment 3 Laurent Alquier 2010-06-08 22:49:30 UTC
Hi again

It looks like I was looking at two issues :

1- The PHP error from Validator (which happens only when Yahoomaps is used as an input type in forms)
2- Maps form inputs not working at all.

I think I found a solution to #2:

If I replace $wgParser by $wgOut in line 43 of SM_YahooMapsFormInput.php, the form input is working again. With $wgParser, it stops working.

     MapsYahooMaps::addYMapDependencies( $wgOut );

I did the same to the OpenLayers form input and the map appears as expected, but there is no 'Lookup coordinates' button (can OpenLayers be used at all as a form input ?).

I still have no clue as to what is causing #1.
Comment 4 Jeroen De Dauw 2010-06-09 05:09:20 UTC
What are the versions of the other extensions you are using? Esp Validator, Maps, SMW and SF.

There is a known issue that maps won't work on SF query pages. I'm assuming that's what's causing issues for you, looking at your description of the problem.
Comment 5 Laurent Alquier 2010-06-09 11:42:20 UTC
I am using Maps/Semantic Maps/Validator from the 0.6.2 tar file. 
Semantic Forms is 1.9.

I am using a plain form with a form input for coordinates. Nothing fancy. I am not using the runQuery side of SF.

To summarize, so far, I found 3 issues with 0.6.2 and I could only fix one of them.

1- Form Inputs do not display a map (I had to replace $wgParser by $wgOut in the calls to map dependencies to fix that)

2- I get a PHP warning about an undefined variable when I use the Yahoo maps form input

3- If I try the Open Layers form input, the 'Lookup coordinates' button is missing.
Comment 6 Jeroen De Dauw 2010-06-09 11:47:42 UTC
1- It seems to be working fine on other sites - example: http://hackerspace.be/Special:FormEdit/Event/Brion_vibber_day

2- Quite possible, I have not explicitly tested the Yahoo! Maps forms. Will have a look soon. It's possible point 1 is only present for Yahoo! Maps.

3- There never was such a button. OpenLayers forms don't have geocoding support, unfortunately.
Comment 7 Laurent Alquier 2010-06-09 12:02:49 UTC
Thanks for the link - I will check it out and see if I am missing something on my site.

#1 is happening for both OpenLayers and Yahoo. If I leave $wgParser in the call for dependencies, the call fails and maps do not display at all in the form. 

#3 - Fair enough. I will force geocoding with geonames and see what happens.
Comment 8 Jeroen De Dauw 2010-06-09 12:32:04 UTC
I fixed 2 in http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67710

Will be part of 0.6.3.
Comment 9 Jeroen De Dauw 2010-06-09 12:44:30 UTC
1 is also fixed in http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67713

Apparently I only changed it for Google Maps and forgot the other services...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links