The method
public function move_to_structure($page_ref_id, $structure_id, $begin=true)
changes the moved node's structure_id, but not the children's structure_id. The target structure will still show the children, but will not allow them to be moved. (Pressing save will have no effect, basically causing a read-only structure, with no warnings or errors ouptut)
Here's your fix:
public function move_to_structure($page_ref_id, $structure_id, $begin=true) { $page_info = $this->s_get_page_info($page_ref_id); $query = "update `tiki_structures` set `pos`=`pos`-1 where `pos`>? and `parent_id`=?"; $this->query($query, array((int) $page_info["pos"], (int) $page_info["parent_id"])); if ($begin) { $query = "update `tiki_structures` set `pos`=`pos`+1 where `parent_id`=?"; $this->query($query, array($structure_id)); $pos = 1; $query = "update `tiki_structures` set `structure_id`=?, `parent_id`=?, `pos`=? where `page_ref_id`=?"; $this->query($query, array($structure_id, $structure_id, $pos+1, $page_ref_id)); } else { $query = "select max(`pos`) from `tiki_structures` where `parent_id`=?"; $pos = $this->getOne($query, array($structure_id)); $query = "update `tiki_structures` set `structure_id`=?, `parent_id`=?, `pos`=? where `page_ref_id`=?"; $this->query($query, array($structure_id, $structure_id, $pos+1, $page_ref_id)); } // get the page_ref_ids of all child pages of the moved page $child_ref_ids = array(); $result = $this->query("select child.page_ref_id from tiki_structures p inner join tiki_structures child on child.parent_id = p.page_ref_id where p.page_ref_id=" . $page_ref_id); while ($row = $result->fetchRow()){ array_push($child_ref_ids, $row['page_ref_id']); } // update the structure ids of the child pages $this->query("update tiki_structures set structure_id=" . $structure_id . " where page_ref_id in (" . implode(',',$child_ref_ids) . ")"); }
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.