forked from Public/pics
Asset/Thumbnail: replace 'NULL' placeholder strings with actual null values
This commit is contained in:
@@ -32,7 +32,7 @@ class Asset
|
||||
$this->$attribute = $value;
|
||||
}
|
||||
|
||||
if (isset($data['date_captured']) && $data['date_captured'] !== 'NULL' && !is_object($data['date_captured']))
|
||||
if (isset($data['date_captured']) && $data['date_captured'] !== null && !is_object($data['date_captured']))
|
||||
$this->date_captured = new DateTime($data['date_captured']);
|
||||
}
|
||||
|
||||
@@ -273,9 +273,9 @@ class Asset
|
||||
'title' => $title,
|
||||
'slug' => $slug,
|
||||
'mimetype' => $mimetype,
|
||||
'image_width' => isset($image_width) ? $image_width : 'NULL',
|
||||
'image_height' => isset($image_height) ? $image_height : 'NULL',
|
||||
'date_captured' => isset($date_captured) ? $date_captured : 'NULL',
|
||||
'image_width' => isset($image_width) ? $image_width : null,
|
||||
'image_height' => isset($image_height) ? $image_height : null,
|
||||
'date_captured' => isset($date_captured) ? $date_captured : null,
|
||||
'priority' => isset($priority) ? (int) $priority : 0,
|
||||
]);
|
||||
|
||||
@@ -504,9 +504,9 @@ class Asset
|
||||
[
|
||||
'id_asset' => $this->id_asset,
|
||||
'mimetype' => $this->mimetype,
|
||||
'image_width' => isset($this->image_width) ? $this->image_width : 'NULL',
|
||||
'image_height' => isset($this->image_height) ? $this->image_height : 'NULL',
|
||||
'date_captured' => isset($this->date_captured) ? $this->date_captured : 'NULL',
|
||||
'image_width' => isset($this->image_width) ? $this->image_width : null,
|
||||
'image_height' => isset($this->image_height) ? $this->image_height : null,
|
||||
'date_captured' => isset($this->date_captured) ? $this->date_captured : null,
|
||||
'priority' => $this->priority,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user