Commit 39b1eedd authored by Leigh Stoller's avatar Leigh Stoller

Multi-Architecture fix; the test for determining if a type was really

a class (say, pc or pcvm) was wrong.
parent 6fcfb6ba
......@@ -88,6 +88,7 @@ sub LookupRow($$$)
# Do not use the embedded type field, cause of auxtypes.
$self->{"TYPE"} = $type;
$self->{"DBROW"} = $row;
$self->{"CLASS"} = ($type eq $row->{"class"} ? $type : undef);
$self->{"ATTRS"} = undef;
bless($self, $class);
......@@ -148,7 +149,11 @@ sub LookupAny($$)
if (!$query_result);
if ($query_result->numrows) {
my ($ntype) = $query_result->fetchrow_array();
return NodeType->Lookup($ntype);
my $obj = NodeType->Lookup($ntype);
return undef
if (!defined($obj));
$obj->{'CLASS'} = $type;
return $obj;
}
$query_result =
......@@ -299,18 +304,14 @@ sub Stringify($)
}
#
# Is the argument a class instead of a type.
# Did we find this type cause it was a class lookup. Bogus, need a
# different object for this.
#
sub IsClass($)
{
my ($self) = @_;
my $type = $self->type();
my $query_result =
DBQueryWarn("select type from node_types ".
"where class='$type' and class!=type limit 1");
return $query_result->numrows;
return (defined($self->{'CLASS'}) ? 1 : 0);
}
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment