[ic] Spreadsheet save errors

Mike Heins interchange-users@interchange.redhat.com
Thu Oct 11 20:29:00 2001


Quoting Jerry (jerry@data-logic.com):
> Could someone shed a little light on errors
> generated when saving in spreadsheet edit?
> Seems no matter how I setup the meta information
> I get this error. Could someone help with what
> the min and max is refering to and more importantly
> how to fix it?

That is a bug in interchange.PL.

It is already fixed in devel CVS, but that is probably no good for
you. I will see what I can do to fix it in stable soon...

The patch (untested in stable, but tested in devel) is:

*** interchange.PL	2001/09/04 13:25:17	2.7.2.2
--- interchange.PL	2001/10/12 00:22:45
***************
*** 644,650 ****
  
  	while (($key, $value) = each %CGI::values) {
  		next unless defined $data{$key};
! 		$count = (@{$data{$key}} = split /\0/, $value);
  		$max = $count, $maxname = $key if $count > $max;
  		$min = $count, $minname = $key if $count < $min;
  	}
--- 644,650 ----
  
  	while (($key, $value) = each %CGI::values) {
  		next unless defined $data{$key};
! 		$count = (@{$data{$key}} = split /\0/, $value, -1);
  		$max = $count, $maxname = $key if $count > $max;
  		$min = $count, $minname = $key if $count < $min;
  	}
***************
*** 843,848 ****
--- 843,853 ----
  			}
  			$select_key = $value if $_ eq $prikey;
  			push(@v, $value);
+ 		}
+ 
+ 		if(! length($select_key) ) {
+ 			next if  defined $CGI::values{mv_update_empty_key}
+ 					 and   ! $CGI::values{mv_update_empty_key};
  		}
  
  		if($function eq 'delete') {

The reason it was not automatically applied to stable is it could affect
operation where someone wanted to autonumber or update an empty key value.
I still have to investigate that...

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

I am a great believer in luck, and I find that the harder I work
the more luck I have. -- Thomas Jefferson