Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1492)
+++ branches/2.8.x/CHANGELOG	(revision 1493)
@@ -12,6 +12,8 @@
 
 =============================== FEATURES FREEZE ================================
 ----------------------------------- Fixes 2.8.2 --------------------------------
+11 Aug-2011 Build 1493 Dietmar Woellbrink (Luisehahne)
+# Ticket #1106 FatalError in groups module
 11 Aug-2011 Build 1492 Dietmar Woellbrink (Luisehahne)
 # Ticket #1107 Deleting users not possible
   Change handling, first user will be set to inactive
Index: branches/2.8.x/wb/admin/groups/save.php
===================================================================
--- branches/2.8.x/wb/admin/groups/save.php	(revision 1492)
+++ branches/2.8.x/wb/admin/groups/save.php	(revision 1493)
@@ -29,15 +29,14 @@
 	$admin->print_header();
 	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$js_back);
 }
-// After check print the header
-$admin->print_header();
 
 // Check if group group_id is a valid number and doesnt equal 1
-if(!isset($_POST['group_id']) OR !is_numeric($_POST['group_id']) OR $_POST['group_id'] == 1) {
-	header("Location: index.php");
-	exit(0);
-} else {
-	$group_id = $_POST['group_id'];
+$group_id = intval($admin->checkIDKEY('group_id', 0, $_SERVER['REQUEST_METHOD']));
+if( ($group_id < 2 ) )
+{
+	// if($admin_header) { $admin->print_header(); }
+	$admin->print_header();
+	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'] );
 }
 
 // Gather details entered
@@ -47,12 +46,14 @@
 if($group_name == "") {
 	$admin->print_error($MESSAGE['GROUPS']['GROUP_NAME_BLANK'], $js_back);
 }
+// After check print the header
+$admin->print_header();
 
 // Get system permissions
 require_once(ADMIN_PATH.'/groups/get_permissions.php');
 
 // Update the database
-$query = "UPDATE ".TABLE_PREFIX."groups SET name = '$group_name', system_permissions = '$system_permissions', module_permissions = '$module_permissions', template_permissions = '$template_permissions' WHERE group_id = '$group_id'";
+$query = "UPDATE `".TABLE_PREFIX."groups` SET `name` = '$group_name', `system_permissions` = '$system_permissions', `module_permissions` = '$module_permissions', `template_permissions` = '$template_permissions' WHERE `group_id` = '$group_id'";
 
 $database->query($query);
 if($database->is_error()) {
Index: branches/2.8.x/wb/admin/groups/groups.php
===================================================================
--- branches/2.8.x/wb/admin/groups/groups.php	(revision 1492)
+++ branches/2.8.x/wb/admin/groups/groups.php	(revision 1493)
@@ -23,6 +23,7 @@
 // Set parameter 'action' as alternative to javascript mechanism
 $action = 'cancel';
 // Set parameter 'action' as alternative to javascript mechanism
+$action = (isset($_POST['action']) && ($_POST['action'] ='modify')   ? 'modify' : $action );
 $action = (isset($_POST['modify']) ? 'modify' : $action );
 $action = (isset($_POST['delete']) ? 'delete' : $action );
 
@@ -33,6 +34,9 @@
 			$admin = new admin('Access', 'groups_modify' );
 			// Check if group group_id is a valid number and doesnt equal 1
 			$group_id = intval($admin->checkIDKEY('group_id', 0, $_SERVER['REQUEST_METHOD']));
+            if($group_id == 0){
+				$admin->print_error($MESSAGE['USERS_NO_GROUP'] );
+            }
 			if( ($group_id < 2 ) )
 			{
 				// if($admin_header) { $admin->print_header(); }
@@ -49,9 +53,9 @@
 			$template->set_var(	array(
 									'ACTION_URL' => ADMIN_URL.'/groups/save.php',
 									'SUBMIT_TITLE' => $TEXT['SAVE'],
-									'GROUP_ID' => $group['group_id'],
+									'GROUP_ID' => $admin->getIDKEY($group['group_id']),
 									'GROUP_NAME' => $group['name'],
-									'ADVANCED_ACTION' => 'groups.php',
+									'ADVANCED_LINK' => 'groups.php',
 									'FTAN' => $admin->getFTAN()
 								));
 			// Tell the browser whether or not to show advanced options
@@ -155,11 +159,15 @@
 			// Parse template object
 			$template->parse('main', 'main_block', false);
 			$template->pparse('output', 'page');
-			break;
+			// Print admin footer
+			$admin->print_footer();			break;
 		case 'delete' :
 			// Create new admin object
 			$admin = new admin('Access', 'groups_delete');
 			$group_id = intval($admin->checkIDKEY('group_id', 0, $_SERVER['REQUEST_METHOD']));
+            if($group_id == 0){
+				$admin->print_error($MESSAGE['USERS_NO_GROUP'] );
+            }
 			// Check if user id is a valid number and doesnt equal 1
 			if( ($group_id < 2 ) )
 			{
@@ -169,12 +177,12 @@
 			// Print header
 			$admin->print_header();
 			// Delete the group
-			$database->query("DELETE FROM ".TABLE_PREFIX."groups WHERE group_id = '".$group_id."' LIMIT 1");
+			$database->query("DELETE FROM `".TABLE_PREFIX."groups` WHERE `group_id` = '".$group_id."' LIMIT 1");
 			if($database->is_error()) {
 				$admin->print_error($database->get_error());
 			} else {
 				// Delete users in the group
-				$database->query("DELETE FROM ".TABLE_PREFIX."users WHERE group_id = '".$group_id."'");
+				$database->query("DELETE FROM `".TABLE_PREFIX."users` WHERE `group_id` = '".$group_id."'");
 				if($database->is_error()) {
 					$admin->print_error($database->get_error());
 				} else {
@@ -181,10 +189,9 @@
 					$admin->print_success($MESSAGE['GROUPS']['DELETED']);
 				}
 			}
+			// Print admin footer
+			$admin->print_footer();
 			break;
 	default:
 			break;
 endswitch;
-
-// Print admin footer
-$admin->print_footer();
Index: branches/2.8.x/wb/admin/groups/index.php
===================================================================
--- branches/2.8.x/wb/admin/groups/index.php	(revision 1492)
+++ branches/2.8.x/wb/admin/groups/index.php	(revision 1493)
@@ -100,7 +100,7 @@
 $template->set_var('DISPLAY_EXTRA', 'display:none;');
 $template->set_var('ACTION_URL', ADMIN_URL.'/groups/add.php');
 $template->set_var('SUBMIT_TITLE', $TEXT['ADD']);
-$template->set_var('ADVANCED_ACTION', 'index.php');
+$template->set_var('ADVANCED_LINK', 'index.php');
 
 // Tell the browser whether or not to show advanced options
 if ( true == (isset( $_POST['advanced']) AND ( strpos( $_POST['advanced'], ">>") > 0 ) ) ) {
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1492)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1493)
@@ -52,4 +52,4 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1492');
+if(!defined('REVISION')) define('REVISION', '1493');
Index: branches/2.8.x/wb/templates/wb_theme/templates/groups_form.htt
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/templates/groups_form.htt	(revision 1492)
+++ branches/2.8.x/wb/templates/wb_theme/templates/groups_form.htt	(revision 1493)
@@ -271,7 +271,7 @@
 </tr>
 
 <tr>
-	<td colspan="2"><input type="submit" name="submit" value="{SUBMIT_TITLE}" /></td>
+	<td colspan="2"><input type="submit" name="save" value="{SUBMIT_TITLE}" /></td>
     <td colspan="2" align="right"><input type="reset" name="reset" value="{TEXT_RESET}" /></td>
 </tr>
 </table>
@@ -280,7 +280,8 @@
 <table summary="" cellpadding="5" cellspacing="0" border="0" width="100%">
 <tr>
 	<td align="center">
-	<form name="advanced" action="{ADVANCED_ACTION}" method="post">
+	<form name="advanced" action="{ADVANCED_LINK}" method="post">
+		<input type="hidden" name="advanced" value="{ADVANCED}" />
         <input type="hidden" name="group_id" value="{GROUP_ID}" />
         <input type="hidden" name="action" value="modify" />
 		{FTAN}
Index: branches/2.8.x/wb/templates/wb_theme/templates/groups.htt
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/templates/groups.htt	(revision 1492)
+++ branches/2.8.x/wb/templates/wb_theme/templates/groups.htt	(revision 1493)
@@ -1,7 +1,6 @@
 <!-- BEGIN main_block -->
 
 <form name="groups" action="groups.php" method="post">
-<input type="hidden" name="action" value="delete" />
 {FTAN}
 <table summary=""  cellpadding="0" cellspacing="0" border="0" width="100%">
 <tr>
Index: branches/2.8.x/wb/templates/argos_theme/templates/groups.htt
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/templates/groups.htt	(revision 1492)
+++ branches/2.8.x/wb/templates/argos_theme/templates/groups.htt	(revision 1493)
@@ -1,8 +1,7 @@
 <!-- BEGIN main_block -->
 
 <form name="groups" action="groups.php" method="post">
-  <input type="hidden" name="action" value="delete" />
- {FTAN}  
+ {FTAN}
   <table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;">
 	<tr style="background:#f0f0f0;">
 		<td align="left"><h2>{HEADING_MODIFY_DELETE_GROUP}</h2></td>
Index: branches/2.8.x/wb/templates/argos_theme/templates/groups_form.htt
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/templates/groups_form.htt	(revision 1492)
+++ branches/2.8.x/wb/templates/argos_theme/templates/groups_form.htt	(revision 1493)
@@ -251,7 +251,7 @@
 <tr style="text-align:center;width:100%">
     <td>&nbsp;</td>
 	<td style="text-align:right;">
-		<input type="submit" name="submit" value="{SUBMIT_TITLE}" />
+		<input type="submit" name="save" value="{SUBMIT_TITLE}" />
 	</td>
 	<td style="text-align:left;">
 		<input type="reset" name="reset" value="{TEXT_RESET}" />
@@ -262,7 +262,7 @@
 </form>
 
 
-<form name="advanced" action="{ADVANCED_ACTION}" method="post">
+<form name="advanced" action="{ADVANCED_LINK}" method="post">
 <input type="hidden" name="group_id" value="{GROUP_ID}" />
 <input type="hidden" name="action" value="modify" />
 {FTAN}
