fix: Thingy shows things from other Thingies

This commit is contained in:
Yung Han Khoe 2008-03-24 14:10:41 +00:00
parent ee59ef42e9
commit e6e89b16ef

View file

@ -383,8 +383,7 @@ sub getEditFieldForm {
"file" => "file",
);
$things = $self->session->db->read('select thingId, label from Thingy_things left join asset using(assetId)
where asset.state = "published"');
$things = $self->session->db->read('select thingId, label from Thingy_things where assetId =?',[$self->getId]);
while (my $thing = $things->hashRef) {
my $fieldType = "otherThing_".$thing->{thingId};
$fieldTypes{$fieldType} = $thing->{label};
@ -1286,8 +1285,8 @@ sub www_editThing {
"addThing" => $i18n->get('add thing label'),
"thingyDefault" => $i18n->get('view thingy default label'),
);
my $otherThings = $session->db->read("select thingId, label from Thingy_things left join asset using(assetId)
where thingId != ? and asset.state = 'published'",[$thingId]);
my $otherThings = $session->db->read("select thingId, label from Thingy_things where thingId != ? and assetId =?",
[$thingId,$self->getId]);
while (my $otherThing = $otherThings->hashRef) {
$afterSave{'searchOther_'.$otherThing->{thingId}} = $i18n->get('search other thing label').$otherThing->{label};
$afterSave{'addOther_'.$otherThing->{thingId}} = $i18n->get('add other thing label').$otherThing->{label};