fix: 🐛 fix post metadata fill-out failing on non-found posts
This commit is contained in:
parent
37357da4b0
commit
2ee294b012
2 changed files with 6 additions and 0 deletions
|
@ -116,6 +116,8 @@ class MySQLAdapter {
|
|||
$post_data = $this->_exec($qry, "s", $post_path)->fetch_assoc();
|
||||
$post_data = $this->_normalize_post_data($post_data);
|
||||
|
||||
$post_data['post_path'] = $post_path;
|
||||
|
||||
if($with_subposts) {
|
||||
$post_data['subposts'] = $this->get_subposts_by_path($post_path);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ class PostHandler extends MySQLAdapter {
|
|||
function _normalize_post_data($post_data) {
|
||||
$post_data = parent::_normalize_post_data($post_data);
|
||||
|
||||
if(!$post_data['found']) {
|
||||
return $post_data;
|
||||
}
|
||||
|
||||
$post_data["post_basename"] = basename($post_data["post_path"]);
|
||||
|
||||
$post_meta = $post_data['post_metadata'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue