Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] change permission for admin user
#1
When i try and change some admincp permission for a admin user it gives off this error

Code:
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1364 - Field 'notes' doesn't have a default value
Query:
    INSERT INTO mybb_adminoptions (`uid`,`permissions`) VALUES ('2','a:1:{s:6:\"config\";a:15:{s:8:\"settings\";s:1:\"1\";s:7:\"banning\";s:1:\"0\";s:14:\"profile_fields\";s:1:\"0\";s:7:\"smilies\";s:1:\"0\";s:8:\"badwords\";s:1:\"0\";s:6:\"mycode\";s:1:\"0\";s:9:\"languages\";s:1:\"0\";s:10:\"post_icons\";s:1:\"0\";s:14:\"help_documents\";s:1:\"0\";s:7:\"plugins\";s:1:\"0\";s:16:\"attachment_types\";s:1:\"0\";s:7:\"spiders\";s:1:\"0\";s:9:\"calendars\";s:1:\"0\";s:7:\"warning\";s:1:\"0\";s:9:\"mod_tools\";s:1:\"0\";}}')

Using:
Webserver: IIS7
php: 5.2.9-2
mysql: MySQLi 5.0.83
#2
What version of MyBB are you running? I cannot reproduce.
-Doug
1scream Founder
Former MyBB Developer & SQA Member
My Twitter
#3
mybb 1.4.7 what i done is this

What i done is add user x to admin group tried to edit that users admin permission (not group) and it gave off that error.
#4
Your running MySQL in Strict mode?
#5
Umm not to sure how do i find out i am also got the setting in config.php to use mysqli
#6
I have similar bug when I try to change admin permission in ACP:

Quote:/home/......./public_html/inc/languages/english/tools_reputations.lang.php does not exist

MyBB 1.4.7

Link: http://www...................../admin/index.php?module=user/admin_permissions&action=edit&uid=0
[Image: moderator-btn.png]
#7
That's not similar, the first post is about mysql. That's a php error.

And as notes, permissions and defaultviews is all in text and has no default value they have to be added as '' in all queries related to inserting into adminoptions.

In admin/inc/functions_view_manager.php
PHP Code:
    if($create == true)
    {
        
$updated_admin['uid'] = $mybb->user['uid'];
        
$db->insert_query("adminoptions"$updated_admin);
    } 
needs to change to
PHP Code:
    if($create == true)
    {
        
$updated_admin['uid'] = $mybb->user['uid'];
        
$updated_admin['notes'] = '';
        
$updated_admin['permissions'] = '';
        
$db->insert_query("adminoptions"$updated_admin);
    } 
admin/modules/user/admin_permissions.php
PHP Code:
$db->insert_query("adminoptions", array('uid' => intval($mybb->input['uid']), 'permissions' => $db->escape_string(serialize($mybb->input['permissions'])))); 
Needs to be:
PHP Code:
$db->insert_query("adminoptions", array(
        
'uid' => intval($mybb->input['uid']),
        
'permissions' => $db->escape_string(serialize($mybb->input['permissions'])),
        
'notes' => '',
        
'defaultviews' => '',
    )
); 

This will only affect strict versions of MySQL, but alot of people use strict so.
#8
Thanks Martin... Smile
#9
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group


Forum Jump:


Users browsing this thread: