From: <al...@us...> - 2008-10-21 20:55:36
|
Revision: 746 http://sciret.svn.sourceforge.net/sciret/?rev=746&view=rev Author: alpeb Date: 2008-10-21 20:55:21 +0000 (Tue, 21 Oct 2008) Log Message: ----------- couple of bugs Modified Paths: -------------- trunk/actions/DeleteCategory.php trunk/models/Category.php Modified: trunk/actions/DeleteCategory.php =================================================================== --- trunk/actions/DeleteCategory.php 2008-10-21 19:47:40 UTC (rev 745) +++ trunk/actions/DeleteCategory.php 2008-10-21 20:55:21 UTC (rev 746) @@ -17,6 +17,7 @@ function dispatch() { $catId = isset($_GET['catId'])? (int)$_GET['catId'] : 0; $category = new Category($catId); + $parentId = $category->getParentId(); if (!$category->getId()) { $_SESSION['message'] = $this->user->lang('Wrong category ID'); Library::redirect(Library::getLink(array('view' => 'EditCategories'))); @@ -27,7 +28,7 @@ } $_SESSION['message'] = $this->user->lang('Category deleted successfully'); - Library::redirect(Library::getLink(array('view' => 'EditCategories'))); + Library::redirect(Library::getLink(array('view' => 'MainView', 'catId' => $parentId))); } } Modified: trunk/models/Category.php =================================================================== --- trunk/models/Category.php 2008-10-21 19:47:40 UTC (rev 745) +++ trunk/models/Category.php 2008-10-21 20:55:21 UTC (rev 746) @@ -46,7 +46,7 @@ function delete() { $query = 'SELECT cat_id FROM categories WHERE parent_id=?'; $result = DB::getInstance()->query($query, $this->id); - if ($result->getNumRows() > 0) { + if ($result->rowCount() > 0) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |