MyBB Community Forums

Full Version: Error in Admin cp
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
error in admin cp

[Image: erroryir.jpg]
Moved to plugin support as it's to do with new points.
I've got the same problem trying to convert my tables to UTF-8 ... Searching in the files, it should be there the problem is located.
It hasn't to do with plugins, it's a MyBB problem Wink

The problem is a result of changes in admin/modules/tools/system_health.php since MyBB 1.4.6. I just uploaded those files and now it works perfectly Wink

--- /home/kevin/Desktop/Downloads/mybb_1406/Upload/admin/modules/tools/system_health.php	2009-05-03 08:33:32.000000000 +0200
+++ /home/kevin/Desktop/Downloads/mybb_1412/Upload/admin/modules/tools/system_health.php	2010-02-24 23:05:36.000000000 +0100
@@ -23,7 +23,7 @@
 {
 	$plugins->run_hooks("admin_tools_system_health_utf8_conversion");
 	
-	if($db->type == "sqlite2" || $db->type == "sqlite3")
+	if($db->type == "sqlite2" || $db->type == "sqlite3" || $db->type == "pgsql")
 	{
 		flash_message($lang->error_not_supported, 'error');
 		admin_redirect("index.php?module=tools/system_health");
@@ -97,6 +97,8 @@
 			'tinytext' => 'tinyblob'			
 		);
 		
+		$blob_types = array( 'blob', 'tinyblob', 'mediumblog', 'longblob', 'text', 'tinytext', 'mediumtext', 'longtext' );
+		
 		// Get next table in list
 		$convert_to_binary = '';
 		$convert_to_utf8 = '';
@@ -135,25 +137,39 @@
 				// Build the actual strings for converting the columns
 				$names = "CHANGE `{$column['Field']}` `{$column['Field']}` ";
 				
-				$attributes = " DEFAULT ";
-				if($column['Default'] == 'NULL')
+				if(($db->type == 'mysql' || $db->type == 'mysqli') && in_array($type, $blob_types))
 				{
-					$attributes .= "NULL ";
+					if($column['Null'] == 'YES')
+					{
+						$attributes = 'NULL';
+					}
+					else
+					{
+						$attributes = 'NOT NULL';
+					}
 				}
 				else
 				{
-					$attributes .= "'".$db->escape_string($column['Default'])."' ";
-					
-					if($column['Null'] == 'YES')
+					$attributes = " DEFAULT ";
+					if($column['Default'] == 'NULL')
 					{
-						$attributes .= 'NULL';
+						$attributes .= "NULL ";
 					}
 					else
 					{
-						$attributes .= 'NOT NULL';
+						$attributes .= "'".$db->escape_string($column['Default'])."' ";
+						
+						if($column['Null'] == 'YES')
+						{
+							$attributes .= 'NULL';
+						}
+						else
+						{
+							$attributes .= 'NOT NULL';
+						}
 					}
 				}
-				
+
 				$convert_to_binary .= $comma.$names.preg_replace('/'.$type.'/i', $types[$type], $column['Type']).$attributes;
 				$convert_to_utf8 .= "{$comma}{$names}{$column['Type']} CHARACTER SET utf8 COLLATE utf8_general_ci{$attributes}";
 				
(2010-04-18, 10:15 AM)Paretje Wrote: [ -> ]It hasn't to do with plugins, it's a MyBB problem Wink

The problem is a result of changes in admin/modules/tools/system_health.php since MyBB 1.4.6. I just uploaded those files and now it works perfectly Wink

sorry buddy i could not get it which file i need to replace?? and what is the code for?? and where do I should place it kindly guide me.


Regards,
RFI
(2010-04-18, 10:14 AM)MattRogowski Wrote: [ -> ]Moved to plugin support as it's to do with new points.

matt thanks for attention 'the point' system at my site is working quite fine.