From ec7769251b1ac0698c6e516518222d19408c3e48 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Fri, 10 May 2019 20:03:05 +0200 Subject: [PATCH] get parent type for the child --- bl-kernel/pages.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bl-kernel/pages.class.php b/bl-kernel/pages.class.php index 33a050cd..ecf845e9 100644 --- a/bl-kernel/pages.class.php +++ b/bl-kernel/pages.class.php @@ -81,7 +81,11 @@ class Pages extends dbJSON { // Parent // This variable is not belong to the database so is not defined in $row - $parent = (empty($args['parent'])?'':$args['parent']); + $parent = ''; + if (!empty($args['parent'])) { + $parent = $args['parent']; + $row['type'] = $this->db[$parent]['type']; // get the parent type + } // Slug from the title or the content // This variable is not belong to the database so is not defined in $row @@ -177,7 +181,11 @@ class Pages extends dbJSON { // Parent // This variable is not belong to the database so is not defined in $row - $parent = (empty($args['parent'])?'':$args['parent']); + $parent = ''; + if (!empty($args['parent'])) { + $parent = $args['parent']; + $row['type'] = $this->db[$parent]['type']; // get the parent type + } // Slug // If the user change the slug the page key changes