added suggestions
This commit is contained in:
parent
220f8f0862
commit
26d4214c19
|
@ -12,6 +12,7 @@ use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
|
|
||||||
function uexport_init(App $a) {
|
function uexport_init(App $a) {
|
||||||
|
/// @todo Don't forget to move this global field as static field in src/Modules
|
||||||
global $dbStructure;
|
global $dbStructure;
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
|
@ -74,7 +75,7 @@ function _uexport_multirow($query) {
|
||||||
foreach ($rr as $k => $v) {
|
foreach ($rr as $k => $v) {
|
||||||
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
$p[$k] = !empty($v) ? $v : DBA::NULL_DATETIME;
|
$p[$k] = $v ?? DBA::NULL_DATETIME;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$p[$k] = $v;
|
$p[$k] = $v;
|
||||||
|
@ -101,7 +102,7 @@ function _uexport_row($query) {
|
||||||
foreach ($rr as $k => $v) {
|
foreach ($rr as $k => $v) {
|
||||||
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
$result[$k] = !empty($v) ? $v : DBA::NULL_DATETIME;
|
$result[$k] = $v ?? DBA::NULL_DATETIME;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result[$k] = $v;
|
$result[$k] = $v;
|
||||||
|
|
|
@ -53,7 +53,7 @@ class UserImport
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ttype[$icol] === 'datetime') {
|
if ($ttype[$icol] === 'datetime') {
|
||||||
$arr[$icol] = !empty($ival) ? $ival : DBA::NULL_DATETIME;
|
$arr[$icol] = $ival ?? DBA::NULL_DATETIME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue