Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form submit = SQL Error #140

Open
GasmoN opened this issue Jan 16, 2025 · 0 comments
Open

Form submit = SQL Error #140

GasmoN opened this issue Jan 16, 2025 · 0 comments
Labels

Comments

@GasmoN
Copy link

GasmoN commented Jan 16, 2025

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Install plugin as usual
  2. Add new form (just one text object for testing purposes) and submit field
  3. Type a text inside textarea you just added
  4. Try to submit a form
  5. https://prnt.sc/ulCPM8ySEo7O

Expected behavior
It should submit it normally

Desktop (please complete the following information):

  • MyBB version: 1.8.38
  • Plugin version: 2.6.6
  • PHP version: 7.4.33
  • MySQL version: 10.11.9-MariaDB

Please add an export of your form if the issue is within processing the form

[{"name":"test","active":"1","fid":"-1","tid":"0","overridebutton":"0","class":"","settings":{"allowedgidtype":"0","allowedgid":["4"],"customdenied":"","limitusage":"","pmusers":"","prefix":"0","uid":"","customsuccess":"","signature":"0","posticon":"0","showsummary":"0","summaryparsed":"0","customsummary":"","width":"","labelwidth":"","pmgroups":[""]},"subjecttemplate":null,"messagetemplate":null,"fields":[{"fieldid":"1","name":"TEXT","description":"","type":"2","default":"","required":"1","order":"0","class":"","settings":{"placeholder":"","maxlength":"","regex":"","regexerror":"","cols":"","rows":"","resize":"1"}},{"fieldid":"2","name":"Send","description":"","type":"11","default":"","required":"0","order":"1","class":"","settings":null}],"usage":[]}]

EDIT:
After checking error logs, this is what I found

SQL Error: 1364 - Field 'datetime' doesn't have a default value Query: INSERT INTO mybb_fc_formusage (formid,uid,ref) VALUES ('1',1,1)

To fix it, deactivate and uninstall plugin. Edit the following lines in class_formcreator.php and upload that edited file
array(
"Field" => "datetime",
"Type" => "timestamp",
"NULL" => 0)));

--->>

        array(
            "Field" => "datetime",
            "Type" => "timestamp",
            "NULL" => 1)));

then install and activate plugin.

-

And there is also issue if "post as user" is -1. It should post as bot but instead it gives this sql error.

SQL Error: 1264 - Out of range value for column 'uid' at row 1
Query:
INSERT
INTO mybb_threads (`fid`,`subject`,`prefix`,`icon`,`uid`,`username`,`dateline`,`lastpost`,`lastposter`,`lastposteruid`,`views`,`replies`,`visible`,`notes`)
VALUES ('17','Form submission: test',0,0,-1,'Form Creator Bot',1737029477,1737029477,'Form Creator Bot',-1,0,0,1,'')

Temp FIX: Just leave the option empty so the user who submitted a form will be also the author of it.

@GasmoN GasmoN added the bug label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant