Skip to content

Commit f460430

Browse files
author
Anas
authored
Merge pull request #47 from dreamfactorysoftware/develop
Merging develop branch
2 parents 93e229f + 99e19ba commit f460430

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/Components/Schema.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,8 @@ public function typecastToNative($value, $field_info, $allow_null = true)
21402140
break;
21412141

21422142
case DbSimpleTypes::TYPE_DECIMAL:
2143+
$value = sprintf('%f', floatval($value));
2144+
break;
21432145
case DbSimpleTypes::TYPE_DOUBLE:
21442146
case DbSimpleTypes::TYPE_FLOAT:
21452147
$value = floatval($value);

src/Resources/BaseDbTableResource.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,10 @@ protected function retrieveRelationRecords(TableSchema $schema, RelationSchema $
22462246
$extras['fields'] = $fields;
22472247
}
22482248
$relatedRecords = $this->retrieveVirtualRecords($refService, '_table/' . $refTable, $extras);
2249+
// For some bizarre reason, on Debian 9, duplicates of related tables are returned. (It returns the related table, multiplied by the
2250+
// total number of records, e.g 8 records, 8 duplicates.) In fear of breaking things elsewhere, the below will check and delete
2251+
// any duplicate entries and update. If there aren't any to begin with, then nothing will change.
2252+
$relatedRecords = array_unique($relatedRecords, SORT_REGULAR);
22492253

22502254
// Map the records back to data
22512255
if (!empty($relatedRecords)) {

0 commit comments

Comments
 (0)