From: Victor B. <vb...@us...> - 2004-04-21 14:17:56
|
Update of /cvsroot/mantisbt/mantisbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2317 Modified Files: news_delete.php Log Message: Fix #3723: No ability to edit or even delete news is associated project was deleted. M core/news_api.php - (news_delete_all): Delete all news associated with a project. M core/projects_api.php - (project_delete): Call news_delete_all to delete news associated with a project. M news_delete.php - Delete news with checking project access level if project no longer exists. This is to allow deleting the news entries which should have been deleted when their corresponding projects were deleted. Index: news_delete.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/news_delete.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- news_delete.php 11 Jan 2004 07:16:07 -0000 1.20 +++ news_delete.php 21 Apr 2004 14:15:25 -0000 1.21 @@ -21,13 +21,16 @@ $row = news_get_row( $f_news_id ); - access_ensure_project_level( config_get( 'manage_news_threshold' ), $row['project_id'] ); + # This check is to allow deleting of news items that were left orphan due to bug #3723 + if ( project_exists( $row['project_id'] ) ) { + access_ensure_project_level( config_get( 'manage_news_threshold' ), $row['project_id'] ); + } helper_ensure_confirmed( lang_get( 'delete_news_sure_msg' ), lang_get( 'delete_news_item_button' ) ); - news_delete( $f_news_id ); + news_delete( $f_news_id ); - $t_redirect_url = 'news_menu_page.php'; + $t_redirect_url = 'news_menu_page.php'; print_header_redirect( $t_redirect_url ); ?> |