Loop on expected fields instead of existing fields in Settings\UserExport
- We don't delete fields, so there can be more fields in the database than in the DB structure - Address https://github.com/friendica/friendica/issues/8877#issuecomment-663875895
This commit is contained in:
parent
ac90387d82
commit
40d12b85c4
1 changed files with 5 additions and 8 deletions
|
@ -114,14 +114,11 @@ class UserExport extends BaseSettings
|
||||||
$rows = DBA::p($query);
|
$rows = DBA::p($query);
|
||||||
while ($row = DBA::fetch($rows)) {
|
while ($row = DBA::fetch($rows)) {
|
||||||
$p = [];
|
$p = [];
|
||||||
foreach ($row as $k => $v) {
|
foreach ($dbStructure[$table]['fields'] as $column => $field) {
|
||||||
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
if ($field['type'] == 'datetime') {
|
||||||
case 'datetime':
|
$p[$column] = $v ?? DBA::NULL_DATETIME;
|
||||||
$p[$k] = $v ?? DBA::NULL_DATETIME;
|
} else {
|
||||||
break;
|
$p[$column] = $v;
|
||||||
default:
|
|
||||||
$p[$k] = $v;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$result[] = $p;
|
$result[] = $p;
|
||||||
|
|
Loading…
Reference in a new issue