[ic] Interchange color/size/etc options.
Adam Lambert
tech at khouse.org
Wed Apr 8 18:20:39 UTC 2009
Lovely -- apparently it also tires to set column 'sku' to null
also.... I think I have a bigger problem here than just the db schema....
cut/paste from error.log
<snip IP/date/time/misc stuff>: Safe: DBD::mysql::st execute failed:
Column 'sku' cannot be null at
/usr/local/interchange/lib/Vend/Table/DBI.pm line 1393.
>
>
> my $otab = 'options';
> my $odb = $Db{$otab};
>
> foreach(sort keys %{$CGI}) {
> next unless /^opt_group_(.*)/;
> my $key = $1;
>
> my $name = $CGI->{"opt_group_$key"};
> my $value = $CGI->{"opt_value_$key"};
> my $label = $CGI->{"opt_label_$key"};
>
> next unless $name && $value;
>
> unless($key) {
> if($name =~ /\W/) {
> $Tag->error({
> name => 'Set option groups',
> set => errmsg(qq{Group
name "%s" contains non-word characters, will not set}, $name),
> });
> next;
> }
> $key = $CGI->{sku}."-$name";
> }
>
> my @value = split("\r\n",$value);
>
> my %seen = ();
> my $hasdefault = 0;
>
> my($left,$right);
> map {
> my $default = 0;
> s/[,\r\n]//g;
> if(s/\*//g) { $default = 1; $hasdefault = 1; }
>
> if($v) {
> if(/=/) {
> ($left,$right) = split('=',$_);
> } else {
> $right = $_;
> $left = substr($right,0,3);
> }
>
> while($seen{$left}++) { $left++; }
>
> $_ = join('=',$left,$right);
> if($default) { $_ .= "*"; }
> }
> } @value;
>
> my $value = join(",\n", at value);
>
> $key =~ s/_/-/g; # javascript won't handle form
names with '-'
>
> $odb->set_field($key,'sku',$CGI->{sku});
> $odb->set_field($key,'o_group',$name);
> $odb->set_field($key,'o_value',$value);
> $odb->set_field($key,'o_widget','select');
> $odb->set_field($key,'o_label',$label);
> }
>
> return '';
>
>> I will try that, but are you sure about that? It was explicitly
>> set to require NOT NULL in that schema you sent me -- which seems to
>> indicate that someone somewhere somehow sometime had a reason for it not
>> be null. ??
>>
>> Thanks,
>>
>> --
>> Adam Lambert
>> Koinonia House, Inc.
>>
>
>
> My catalog was upgraded from 4.8, and I just kept using the same mysql
> database from 4.8 - just added any new fields that were needed for the new
> install.
> I don't see much data in the o.master, and I do have many empty o.master
> fields in the records.
> The schema supplied is working correctly on my catalog, not sure why it
> doesn't like the null value.
>
> I would recommend you keep looking at the demo installation for a reference:
> http://demo.icdevgroup.org/demo1/
>
> I looked at the options table in the demo, and selected the spreadsheet
> view - I don't see o.master listed either.
>
> Steve
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
--
Adam Lambert
Koinonia House, Inc.
adam at khouse.org
More information about the interchange-users
mailing list