Current time: 07-23-2014, 11:54 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] change permission for admin user
06-16-2009, 08:36 AM
Post: #1
[F] change permission for admin user
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
Find all posts by this user
06-16-2009, 02:08 PM
Post: #2
RE: change permission for admin user
What version of MyBB are you running? I cannot reproduce.

-Doug
1scream Founder
Former MyBB Developer & SQA Member
My Twitter
Visit this user's website Find all posts by this user
06-16-2009, 02:21 PM
Post: #3
RE: change permission for admin user
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.
Find all posts by this user
06-16-2009, 03:17 PM
Post: #4
RE: change permission for admin user
Your running MySQL in Strict mode?
Visit this user's website Find all posts by this user
06-16-2009, 03:19 PM
Post: #5
RE: change permission for admin user
Umm not to sure how do i find out i am also got the setting in config.php to use mysqli
Find all posts by this user
06-17-2009, 04:57 PM (This post was last modified: 06-17-2009 05:11 PM by DamYan.)
Post: #6
RE: change permission for admin user
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]
Visit this user's website Find all posts by this user
06-17-2009, 05:18 PM (This post was last modified: 06-17-2009 05:18 PM by Martin M..)
Post: #7
RE: change permission for admin user
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.
Find all posts by this user
06-19-2009, 11:12 AM
Post: #8
RE: change permission for admin user
Thanks Martin... Smile
Find all posts by this user
06-19-2009, 11:12 AM
Post: #9
[F] change permission for admin user
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
Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication