Have Thingy check for existance of table and column to prevent
SQL from dying.
This commit is contained in:
parent
6964c2f1d2
commit
ee66303d56
2 changed files with 5 additions and 3 deletions
|
|
@ -26,6 +26,7 @@
|
||||||
- fixed #9001: Thingy add image broken
|
- fixed #9001: Thingy add image broken
|
||||||
- fixed #9386: Gallery: "Image resolutions" issue
|
- fixed #9386: Gallery: "Image resolutions" issue
|
||||||
- fixed #9342: Thingy - Cannot edit a thing
|
- fixed #9342: Thingy - Cannot edit a thing
|
||||||
|
- fixed #9033: Deleting Linked Thing Field Crashes Thingy
|
||||||
|
|
||||||
7.6.7
|
7.6.7
|
||||||
- fixed #9263: Thingy possibleValues processing, and List type autodetection.
|
- fixed #9263: Thingy possibleValues processing, and List type autodetection.
|
||||||
|
|
|
||||||
|
|
@ -914,15 +914,16 @@ sub getFormElement {
|
||||||
$class = 'WebGUI::Form::'. $param{fieldType};
|
$class = 'WebGUI::Form::'. $param{fieldType};
|
||||||
my $options = ();
|
my $options = ();
|
||||||
my $tableName = 'Thingy_'.$otherThingId;
|
my $tableName = 'Thingy_'.$otherThingId;
|
||||||
my ($otherThingTableExists) = $db->quickArray('show tables like ?',[$tableName]);
|
my $fieldName = 'field_'.$data->{fieldInOtherThingId};
|
||||||
|
my ($otherThingTableExists) = $db->quickArray('show tables like ? ?',[$tableName, $fieldName]);
|
||||||
if ($otherThingTableExists){
|
if ($otherThingTableExists){
|
||||||
$options = $db->buildHashRef('select thingDataId, '
|
$options = $db->buildHashRef('select thingDataId, '
|
||||||
.$dbh->quote_identifier('field_'.$data->{fieldInOtherThingId})
|
.$dbh->quote_identifier($fieldName)
|
||||||
.' from '.$dbh->quote_identifier($tableName));
|
.' from '.$dbh->quote_identifier($tableName));
|
||||||
|
|
||||||
my $value = $data->{value} || $data->{defaultValue};
|
my $value = $data->{value} || $data->{defaultValue};
|
||||||
($param{value}) = $db->quickArray('select '
|
($param{value}) = $db->quickArray('select '
|
||||||
.$dbh->quote_identifier('field_'.$data->{fieldInOtherThingId})
|
.$dbh->quote_identifier($fieldName)
|
||||||
.' from '.$dbh->quote_identifier($tableName)
|
.' from '.$dbh->quote_identifier($tableName)
|
||||||
.' where thingDataId = ?',[$value]);
|
.' where thingDataId = ?',[$value]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue