fix: small fix to post data normalization handling missing posts better

This commit is contained in:
David Bailey 2023-12-23 10:51:07 +01:00
parent 2add216157
commit e777ea5675

View file

@ -55,12 +55,12 @@ class MySQLAdapter {
}
function _normalize_post_data($post_data) {
if($post_data == null) {
return [
"found" => false
];
}
$post_data ??= ['found' => null];
if(isset($post_data['found']) && $post_data['found'] == false) {
return $post_data;
}
$post_data["found"] = true;
$post_data['post_metadata'] = json_decode($post_data["post_metadata"], true) ?? [];