Krytic / MyBBWiki

http://krytic.github.io/MyBBWiki
10 stars 4 forks source link

MySQL Errors #1

Closed jefpadfi closed 8 years ago

jefpadfi commented 8 years ago

When I try to install I get errors from Text can't have Default value '' and more about sizing if I remove the default values. Also once I edited the install.php script so the database would create, the settings wouldn't install cause something about sid being null and would never activate. Any idea how to get this installed correctly?

Krytic commented 8 years ago

Thanks for the heads up. I'll check this out. :)

Also, what version of MySQL are you running, and can you post the errors? They should be being logged in MySQL's error logs.

jefpadfi commented 8 years ago

I'll run it again later today to get you the exact errors I was getting. I would love to have this mybb mod. As my community is a small community of a dying fandom which I'd like to preserve as much info as possible.

Krytic commented 8 years ago

Hey, do you have the error messages? v1.1.1 will be out soon so I'd like to fix it in that release. :)

jefpadfi commented 8 years ago

First error I run into is,

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1101 - BLOB/TEXT column 'lastauthor' can't have a default value Query: CREATE TABLE twr2_wiki( id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, authors TEXT(255) NOT NULL, title TEXT(255), content TEXT, watching VARCHAR(65535), protected INT DEFAULT '0', lastauthor TEXT(255) DEFAULT '', lastauthorid INT(8), notepad TEXT(255) DEFAULT '', category TEXT(255), original TEXT ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

So I took out DEFAULT on the lastauthor column to get, notpad can't have defualt value. So once again I took out DEFAULT on the notepad column.

Next error I receive is

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1074 - Column length too big for column 'watching' (max = 21845); use BLOB or TEXT instead Query: CREATE TABLE twr2_wiki( id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, authors TEXT(255) NOT NULL, title TEXT(255), content TEXT, watching VARCHAR(65535), protected INT DEFAULT '0', lastauthor TEXT(255), lastauthorid INT(8), notepad TEXT(255), category TEXT(255), original TEXT ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

So I then changed watching to TEXT instead. Due to varchar totals size limit for the version of my sql im using is 21845

Then it goes to wiki_settings with not able to have default settings in column value. So once again I took out the DEFAULT.

Then finally inserting of data into wiki settings. This is were I stopped and gave up on trying to figure it out myself.

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1366 - Incorrect integer value: 'NULL' for column 'sid' at row 1 Query: INSERT INTO twr2_wiki_settings (sid,name,title,optionscode,value) VALUES ('NULL','wiki_enable','Power Switch','onoff','1')

jefpadfi commented 8 years ago

Also is watching just a boolean value? Couldn't that be a bit for 0, false, 1, true? Or what exactly is that watching?

Krytic commented 8 years ago

Watching is not boolean. It's a comma-separated list of uids that are watching the article.

What version of MySQL are you running? I am running 5.6.17 on my local server and I'm not running into these issues, so I'm thinking it might be because our versions are different, and the query syntax I'm using could be invalid on your MySQL version.

jefpadfi commented 8 years ago

I'm running 5.5.45. I can upgrade if need be. Though you may want to make sure it is compatible with older versions in case people can't choose what version they are using.

I'll upgrade to 5.6.17 and see if it works then. Give me a few hours so I can back up my site and mybb database.

Krytic commented 8 years ago

And is your server Windows or Linux? :)

jefpadfi commented 8 years ago

Windows Server 2012 R2. Running IIS 7

Krytic commented 8 years ago

Try replacing inc/plugins/wiki/installers/install.php with the file in this .zip and try installing it then. :) install.zip

jefpadfi commented 8 years ago

A whole new error.

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1364 - Field 'attachedto' doesn't have a default value Query: INSERT INTO twr2themestylesheets (sid,name,tid,stylesheet,cachefile,lastmodified) VALUES ('','wiki.css','1','ul.btn-group{\n display:block;\n list-style:none;\n overflow:hidden;\n margin-left:5px;\n float: right;\n}\nul.btn-group li{\n display:block;\n float:left;\n}\nul.btn-group li a{\n display:block;\n font-weight:bold;\n text-decoration:none;\n padding:4px 12px 6px 16px;\n color:#888;\n text-shadow:0 1px #fff;\n border:1px solid #d5d5d5;\n border-bottom-color:#ddd;\n background:#ddd;\n background:-webkit-gradient(linear,left top,left bottom,color-stop(.25, #eee),color-stop(1, #ddd));\n background: -webkit-linear-gradient(top,#eee 25%,#ddd 100%);\n background: -moz-linear-gradient(top,#eee 25%,#ddd 100%);\n background: -o-linear-gradient(top,#eee 25%,#ddd 100%);\n background: linear-gradient(top,#eee 25%,#ddd 100%);\n -webkit-box-shadow:inset 0 1px 2px rgba(255,255,255,0.1);\n -moz-box-shadow:inset 0 1px 2px rgba(255,255,255,0.1);\n box-shadow:inset 0 1px 2px rgba(255,255,255,0.1);\n}\nul.btn-group li:first-child a{\n padding:4px 12px 6px 16px;\n border-right:0;\n -webkit-border-radius:18px 0 0 18px;\n -moz-border-radius:18px 0 0 18px;\n border-radius:18px 0 0 18px;\n}\nul.btn-group li:last-child a{\n padding:4px 16px 6px 12px;\n -webkit-border-radius:0 18px 18px 0;\n -moz-border-radius:0 18px 18px 0;\n border-radius:0 18px 18px 0;\n}\nul.btn-group li a:hover{\n background:#eee;\n background:-webkit-gradient(linear,left top,left bottom,color-stop(.25, #fff),color-stop(1, #eee));\n background: -webkit-linear-gradient(top,#fff 25%,#eee 100%);\n background: -moz-linear-gradient(top,#fff 25%,#eee 100%);\n background: -o-linear-gradient(top,#fff 25%,#eee 100%);\n background: linear-gradient(top,#fff 25%,#eee 100%);\n}\nul.btn-group li a:active{\n text-shadow:0 -1px #fff;\n background:#ccc;\n background:-webkit-gradient(linear,left top,left bottom,color-stop(.25, #eee),color-stop(1, #fff));\n background: -webkit-linear-gradient(top,#eee 25%,#fff 100%);\n background: -moz-linear-gradient(top,#eee 25%,#fff 100%);\n background: -o-linear-gradient(top,#eee 25%,#fff 100%);\n background: linear-gradient(top,#eee 25%,#fff 100%);\n -webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);\n -moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);\n box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);\n}\n\n.diff-report del {\n /* This is the removed portion of the diff report /\n text-decoration: none; / Must be present to remove the strikethrough /\n background: #C67171;\n}\n\n.diff-report ins {\n / This is the added portion of the diff report /\n text-decoration: none; /_ Must be present to remove the underline */\n background: #A6D785;\n}','wiki.css',1456520549)

jefpadfi commented 8 years ago

Error is done when activating the plugin.

Krytic commented 8 years ago

In inc/plugins/wiki/installers/install.php, find

'lastmodified' => TIME_NOW,

Replace with

'lastmodified' => TIME_NOW,
'attachedto' => 'wiki.php'

That ought to work.

jefpadfi commented 8 years ago

Gave me,

MyBB has experienced an internal SQL error and cannot continue.

SQL Error: 1366 - Incorrect integer value: '' for column 'sid' at row 1 Query: INSERT INTO twr2themestylesheets (sid,name,tid,stylesheet,cachefile,lastmodified,attachedto) VALUES ('','wiki.css','1','ul.btn-group{\n display:block;\n list-style:none;\n overflow:hidden;\n margin-left:5px;\n float: right;\n}\nul.btn-group li{\n display:block;\n float:left;\n}\nul.btn-group li a{\n display:block;\n font-weight:bold;\n text-decoration:none;\n padding:4px 12px 6px 16px;\n color:#888;\n text-shadow:0 1px #fff;\n border:1px solid #d5d5d5;\n border-bottom-color:#ddd;\n background:#ddd;\n background:-webkit-gradient(linear,left top,left bottom,color-stop(.25, #eee),color-stop(1, #ddd));\n background: -webkit-linear-gradient(top,#eee 25%,#ddd 100%);\n background: -moz-linear-gradient(top,#eee 25%,#ddd 100%);\n background: -o-linear-gradient(top,#eee 25%,#ddd 100%);\n background: linear-gradient(top,#eee 25%,#ddd 100%);\n -webkit-box-shadow:inset 0 1px 2px rgba(255,255,255,0.1);\n -moz-box-shadow:inset 0 1px 2px rgba(255,255,255,0.1);\n box-shadow:inset 0 1px 2px rgba(255,255,255,0.1);\n}\nul.btn-group li:first-child a{\n padding:4px 12px 6px 16px;\n border-right:0;\n -webkit-border-radius:18px 0 0 18px;\n -moz-border-radius:18px 0 0 18px;\n border-radius:18px 0 0 18px;\n}\nul.btn-group li:last-child a{\n padding:4px 16px 6px 12px;\n -webkit-border-radius:0 18px 18px 0;\n -moz-border-radius:0 18px 18px 0;\n border-radius:0 18px 18px 0;\n}\nul.btn-group li a:hover{\n background:#eee;\n background:-webkit-gradient(linear,left top,left bottom,color-stop(.25, #fff),color-stop(1, #eee));\n background: -webkit-linear-gradient(top,#fff 25%,#eee 100%);\n background: -moz-linear-gradient(top,#fff 25%,#eee 100%);\n background: -o-linear-gradient(top,#fff 25%,#eee 100%);\n background: linear-gradient(top,#fff 25%,#eee 100%);\n}\nul.btn-group li a:active{\n text-shadow:0 -1px #fff;\n background:#ccc;\n background:-webkit-gradient(linear,left top,left bottom,color-stop(.25, #eee),color-stop(1, #fff));\n background: -webkit-linear-gradient(top,#eee 25%,#fff 100%);\n background: -moz-linear-gradient(top,#eee 25%,#fff 100%);\n background: -o-linear-gradient(top,#eee 25%,#fff 100%);\n background: linear-gradient(top,#eee 25%,#fff 100%);\n -webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);\n -moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);\n box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);\n}\n\n.diff-report del {\n /* This is the removed portion of the diff report /\n text-decoration: none; / Must be present to remove the strikethrough /\n background: #C67171;\n}\n\n.diff-report ins {\n / This is the added portion of the diff report /\n text-decoration: none; /_ Must be present to remove the underline */\n background: #A6D785;\n}','wiki.css',1456521250,'wiki.php')

Krytic commented 8 years ago

Try removing 'sid' => NULL, from that file.

jefpadfi commented 8 years ago

Took out "tid" => NULL, in inc/plugins/wiki.php line 140 from current download with modified install.php you supplied. Errors are now gone and installed correctly. And working. Though it seems no link was inserted into the nav for my custom theme which is okay. I'll insert one for myself.

jefpadfi commented 8 years ago

Though I can't find the settings other than going to the Plugin page and clicking settings. Nor can I see how to add anything other than default items when creating a page. Such as category. I'm going to go read up on the documentation to figure it all out now.

Krytic commented 8 years ago

Okay, thank you for that. I'm going to commit the modified file to master and close this issue then. :)

For the record: