WildcardSearch / Advanced-Sidebox

A plugin for MyBB forums that displays custom boxes on various forum pages.
GNU General Public License v3.0
20 stars 10 forks source link

I got this error #79

Closed Howman closed 11 years ago

Howman commented 11 years ago

Advanced Sidebox 1.6.2

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1366 - Incorrect integer value: 'NULL' for column 'gid' at row 1 Query: INSERT INTO mybb_settinggroups (gid,name,title,description,disporder,isdefault) VALUES ('NULL','adv_sidebox_settings','Advanced Sidebox','control where and how the sideboxes display','101','no')

This is on a clean install of MyBB 1.6.10

WildcardSearch commented 11 years ago

Thanks for the report-- will look into it.

Howman commented 11 years ago

If I knew more about php and data bases I could help more. I guess I really learn but I am more of a visual type, I learn more from watching then reading. I know there is a lot on the net to read about php but it takes to long for me to grasp it, that's why I uselessly just give up.

WildcardSearch commented 11 years ago

It looks like I've made an error in the install functions and will try to get an update done in a couple of days. Sorry work just has me tied up right now.

Howman commented 11 years ago

I changed all the NULL to 0 and no to 0 after that there was a php error that came up but went away really quickly could not see what it said, checked the php error log and I do not see nothing there so I hope I am ok Trying plugin a bit I found Drag and drop does not seam to work it will drag but not drop will try a different browser using firefox Ux 23.0a1. IE 10 same thing drag but no drop your help image shows in firefox but not IE chrome same as others and you help image does not show. that's all I see right now

WildcardSearch commented 11 years ago

I did a little research and that is the proper way to do a settingsgroup insert . . . maybe it is a problem with the error reoprting level in your testing environment (MyBB ignores E_NOTICE and E_WARNING I think).

Howman commented 11 years ago

Well I got a IIS 8 server on windows server 2012 and with the php manger i can run more then one php version right now I got php 5.2.17 php 5.3.24 php 5.4.14 php 5.5.0 beta 4 x64 php 5.5.0 beta 4 x32 all non thread safe and is set to php 5.4.14 right now but I change at any time I want I can also change from production and development at any time also Let me check again and see if it was something I may Have not set right. tho I thought it was all good.

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1366 - Incorrect integer value: 'NULL' for column 'gid' at row 1 Query: INSERT INTO mybbb_settinggroups (gid,name,title,description,disporder,isdefault) VALUES ('NULL','adv_sidebox_settings','Advanced Sidebox','control where and how the sideboxes display','101','no')

Maybe it's my version of MySql "MySQLi 5.6.11" ??? I do not know how to change mysql version to test that tho

will your side boxes work with 1.8 if i change "compatibility" => "16", to "compatibility" => "17",

avril-gh commented 11 years ago

@WildcardSearch Try pushing gid without quotation marks.

Howman commented 11 years ago

So just remove the " from "gid" in the adv_sidebox_install.php file I just tryed that still same sql error

avril-gh commented 11 years ago

@Howman tell me when when it happen ?

Howman commented 11 years ago

As soon as you hit Install & Activate

avril-gh commented 11 years ago

@Howman You have to remove quotes from gid data (NULL) not from column name (gid)

Hmm.. im not geting this error. Wait ill try to install new mybb and new ASB and see if it happen.

Howman commented 11 years ago

Well now i get

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1366 - Incorrect integer value: '' for column 'gid' at row 1 Query: INSERT INTO mybbb_settinggroups (gid,name,title,description,disporder,isdefault) VALUES ('','adv_sidebox_settings','Advanced Sidebox','control where and how the sideboxes display','101','no')

Howman commented 11 years ago

I think I may have MySQLi 5.5.28 on my other computer should try it on that one

avril-gh commented 11 years ago

@Howman You removed wrong part there, i see quotes are still in place just no data this time..

I think I may have MySQLi 5.5.28 on my other computer should try it on that one

Nah. I think i know whats the problem and its not 5.5.28 whatever,

Im installing now fresh mybb 1610 and ASB and see if can reproduce this error. Will tell you soon what i found.

Howman commented 11 years ago

Ok thank you

WildcardSearch commented 11 years ago

I just tried on a fresh copy of 1.6.10 running on Windows PHP 5.3.8 and couldn't catch any install errors.

Oh and hi @avril-gh :smile:

Howman commented 11 years ago

the php errors showed really quick so quick I did not get a chance to read them So it could not have been anything too bad but the sql error the only way i could fix it was to change "gid" => "NULL" to "gid" => "0" so where ever was NULL I had to put 0 and "isdefault" => "no" had to change to "isdefault" => "0" then it installed then the quick php error but other then that it seams to work

avril-gh commented 11 years ago

@WildcardSearch Hi Wild ~ :raising_hand:

@Howman Java drag and drop Problems with java you mentioned earlier appear if you have outdated myBB, upgrading myBB to 1610 should fix problems with drag and drop java stuff.

SQL error on install I cant reproduce this SQL error but its NOT a bug and its caused because your SQL server is very strictly configured and wont accept NULL as integer. (which he should do) Try to find this line in your SQL server configuration my.cnf file sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" and remove # or add # character at beginning of this line. (depending if its there or not)

Howman commented 11 years ago

O.K well I am using mybb 1.6.10

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

and remove # character from beginning of this line. (as shown below)

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

this is probably my problem cause in the install of 5.6 I did not see the option to turn off safe mode like in 5.5

avril-gh commented 11 years ago

@Howman Just add this line or remove or comment or uncomment (add or remove # from it), depending on if you have this line or not, or its commented (have # in front) or not. Change it to oposite and see if it helps. and ofcourse reset/reboot your SQL server after saving change.

(...) this is probably my problem (...)

Looks like it, because this NULL stuff is valid just your SQL server wont accept it.

Howman commented 11 years ago

Mysql comes with workbench went in to admin general un checked sql-mode which had this line after it STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

that fixed that

here are php errors I checked the error log again [12-May-2013 21:33:09 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282 [12-May-2013 21:33:15 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282 [12-May-2013 21:33:18 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282 [12-May-2013 21:33:59 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282 [12-May-2013 21:34:03 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282 [12-May-2013 21:34:06 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282 [12-May-2013 21:34:13 America/Toronto] PHP Parse error: syntax error, unexpected 'Sidebox' (T_STRING), expecting ')' in C:\inetpub\wwwroot\MySite\Howman.ca\ForumBeta\inc\plugins\adv_sidebox\adv_sidebox_install.php on line 282

avril-gh commented 11 years ago

@Howman

un checked sql-mode which had this line after it STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION that fixed that

So the SQL problem is fixed, nice.

About log - Possibly you broke something when adjusting these quotation marks overwrite adv_sidebox_install.php file with original unaltered file

Howman commented 11 years ago

the time stamp is there but the time on forum is set wrong so those errors are just after I changed mysql then installed. This is the drag and drop but its not showing the circle with the cross through it I just did a ctrl print screen drag drop

avril-gh commented 11 years ago

@Howman Im not sure whats the meaning of last post. (does it have to show that everything works or ? ) Would you like specify what are current issues if any, or its ok now ?

Howman commented 11 years ago

well the drag and drop And I am using MyBB 1.6.10, it will drag but not drop. Thoes errors where from like 9:30 on the forums time

avril-gh commented 11 years ago

@Howman Found the cause. Working on details now and will post solution soon.

Howman commented 11 years ago

O.K. Thank you avril-gh For your help with MYsql fixing STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

avril-gh commented 11 years ago

Fix for Java scripts issue #79

Issue #79 cause - Java script failure is caused by invalid paths of fiew included files. These files are properly loaded if forum is installed in root location, however if forum is installed in non standard location (eg. within folder) then some files cannot be found / loaded / executed, because in this case his paths are invalid.

issue #79 resolve Changing some paths to be relative to `inc/plugins/adv_sidebox' fixing this issue, and makes everything work independently from installation location.

issue #79 code changes which fix non working ASB java script when forum is installed not in site root location

In file acp_functions.php around line 266 updated code are

    // custom CSS
    $page->extra_header .= '<link rel="stylesheet" type="text/css" href="' . $mybb->settings['bburl'] . '/inc/plugins/adv_sidebox/adv_sidebox_acp.css" media="screen" />';

    // scriptaculous drag and drop and effects
    $page->extra_header .= "<script src=\".../jscripts/scriptaculous.js?load=effects,dragdrop,controls\" type=\"text/javascript\"></script>\n";

    // modal forms
    $page->extra_header .=  "<script src=\"jscripts/imodal.js\" type=\"text/javascript\"></script>\n";
    $page->extra_header .=  "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/default/imodal.css\" />\n";

    // custom JS
    $page->extra_header .=  "<script src=\".../jscripts/adv_sidebox_acp.js\" type=\"text/javascript\"></script>\n";

In file adv_sidebox_acp.css around line 110 updated code are

.column.hover {
    background: #f4f4f4 url(../adv_sidebox/images/column_bg.png);
    border: 3px dashed #333;
}

.trashcan {
    width: 99%;
    background: #f4f4f4 url(../adv_sidebox/images/trashcan_bg.png) no-repeat center;
    min-height: 80px;
}

.forum_column {
    background: #f4f4f4 url(../adv_sidebox/images/column_bg.png);
    width: 225px;
    min-height: 300px;
}
Howman commented 11 years ago

Thank you was just about to goto bed almost 2:00 am here in ontario

avril-gh commented 11 years ago

Thank you was just about to goto bed almost 2:00 am here in ontario

hehe, thank you, and thank to Wildcard for brilliant ASB

@Howman Replace this code as shown above and tell us if it fixed your java script issue. We would be glad to know, so @WildcardSearch may update his next release and close this issue as solved.

Howman commented 11 years ago

well the css part is fixed but still will not drop. in firefox's web console in js i get [02:23:49.056] ReferenceError: build_sortable is not defined @ http://www.howman.ca/Forum/admin/index.php?module=config-adv_sidebox:134 if that helps off to bed will try some more tomorrow

Howman commented 11 years ago

O.K I put this in // custom CSS $page->extra_header .= '';

// scriptaculous drag and drop and effects
$page->extra_header .= "<script src=\"./jscripts/scriptaculous.js?load=effects,dragdrop,controls\" type=\"text/javascript\"></script>\n";

// modal forms
$page->extra_header .=  "<script src=\"jscripts/imodal.js\" type=\"text/javascript\"></script>\n";
$page->extra_header .=  "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/default/imodal.css\" />\n";

// custom JS
$page->extra_header .=  "<script src=\"./jscripts/adv_sidebox_acp.js\" type=\"text/javascript\"></script>\n";

then moved dragdrop.js controls.js effects.js scriptaculous.js from jscripts to admin/jscripts and drag and drop works I hope I did not mess something else up

Howman commented 11 years ago

It did not show all my last comment so let me try again I use this // custom CSS $page->extra_header .= '';

// scriptaculous drag and drop and effects
$page->extra_header .= "<script src=\"./jscripts/scriptaculous.js?load=effects,dragdrop,controls\" type=\"text/javascript\"></script>\n";

// modal forms
$page->extra_header .=  "<script src=\"jscripts/imodal.js\" type=\"text/javascript\"></script>\n";
$page->extra_header .=  "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/default/imodal.css\" />\n";

// custom JS
$page->extra_header .=  "<script src=\"./jscripts/adv_sidebox_acp.js\" type=\"text/javascript\"></script>\n";

then moved controls.js dragdrop.js effects.js scriptaculous.js from /jscripts to /admin/jscripts

and Drag and drop working now Hope I did not mess anything else moving those 4 files?

avril-gh commented 11 years ago

In file acp_functions.php (which is within sidebox folder) you have to replace these lines as shown above, because if not then exacly you will get this ReferenceError: build_sortable is not defined error because java script file which define build_sortable cannot be found.

First changes makes page find required java files so drag and drop works and it fix build_sortable not defined and CSS file changes makes page find ASB background pictures which was also missing.

This was tested out and will work if you replace these lines correctly.

Howman commented 11 years ago

its not showing ????? I sent a pm to you and WildcardSearch at mybb

Howman commented 11 years ago

I did get it to work had to move 4 files but it seams to be ok

Howman commented 11 years ago

from jscripts to admin/jscripts

I did replace those lines but i was still getting file not found in firefox's web console but when i moved the 4 files it worked

WildcardSearch commented 11 years ago

It has gotten late here but I will review all of this (and the plugin code) tomorrow.

Thanks for all the help and kind words @avril-gh . . . and @Howman, I will try to get avril's changes figured out and done tomorrow sometime.

Cheers to both of you :smile:

avril-gh commented 11 years ago

@Howman Sorry i missed your PM at mybb. ~ I read it just now.

yes, ofcourse you can move these files to admin/jscripts and this is how it really should be done because they are ACP functions and mybb expect them to be in admin/jscripts and not in root/jscripts. however i respect @WildcardSearch design and if he decided to put these files in root/jscripts, then i decided to not interfere with it, but only adjust paths in acp_functions.php to point there. But ofcourse it would be better and more native to mybb to move some files to admin/jscripts and adjust acp_functions.php paths around line 266 respectively.

JS error build_sortable not defined meant that page cant find js files with this function, and it comes out if mybb is installed in different location than root.

WildcardSearch commented 11 years ago

Yes it was simply igornance on my part not to locate the ACP JavaScript file in the admin folder-- I guess I was simply trying to keep the (only) two JS files in the project together :smile:

I will try to get these changes done today. Thanks to both of you.

Howman commented 11 years ago

NP I will help where I can as I do not know too much about php and mysql But always learning something new to expand my knowledge. Just glad to know there are people out there with patience to let me messy up like that error I had was not with your plugin but with the way I had set up mysql 5.6. But in the end, we together fix something else Thank you WildcardSearch and avril-gh

WildcardSearch commented 11 years ago

Hey man that's why I do this is to learn . . .I am still learning all the time new things and if I help you then that is just fine with me. :smile:

WildcardSearch commented 11 years ago

I believe all is good here. Gonna close.