List Info

Thread: Perl form converter ignores numbers +PATCH




Perl form converter ignores numbers +PATCH
country flaguser name
United States
2007-08-29 08:47:13
We had some test code that effectively did this:

	my %spec = ( Change=>1, ...);
	$p4->SubmitSpec( %spec);

This was getting this error:
	Error in change specification.
	Missing required field 'Change'.

The problem ended up being that PerlClientUser::HashToForm()
would
silently
ignore any hash value that wasn't a string.  The above
really needs to
be:

	my %spec = ( Change=>'1', ...);

The '_Run' method converts numbers to strings when
processing an
argument
list (the code says "Be friendly and convert numeric
args to char *'s),
so it was surprising that this wasn't true for forms.

I've enclosed a patch to add this conversion for forms, and
to produce
a warning when it encounters a form field it can't handle. 
(The warning
could be improved to give the key it's complaining about).

John + Steve
 

-- 
John LoVerso
The MathWorks 

_______________________________________________
p4perl mailing list
p4perlperforce.com

http://maillist.perforce.com/mailman/listinfo/p4perl

  
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )