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

Fatal error when attempting to add a risk item #10

Closed
apeterki opened this issue Oct 23, 2014 · 1 comment
Closed

Fatal error when attempting to add a risk item #10

apeterki opened this issue Oct 23, 2014 · 1 comment

Comments

@apeterki
Copy link

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1364 Field 'mitigation_id' doesn't have a default value' in C:\xampp\htdocs\simplerisk\includes\functions.php:1023 Stack trace: #0 C:\xampp\htdocs\simplerisk\includes\functions.php(1023): PDOStatement->execute() #1 C:\xampp\htdocs\simplerisk\management\index.php(137): submit_risk('New', 'Test', '', 5, '1', '5', 1, 30, 23, 3, 1, 'none', 'none') #2 {main} thrown in C:\xampp\htdocs\simplerisk\includes\functions.php on line 1023

Release: 20141013-001

@jsokol
Copy link
Member

jsokol commented Oct 25, 2014

This error message is due to the MySQL database being set to STRICT mode by default in XAMPP and the mitigation_id field being set as not null, but the query does not specify a value. I have noted this issue for the sake of cleaning up the code and should have a fix for it in the next release. In the meantime, I would recommend taking MySQL out of strict mode so that it doesn't try to enforce these default values on fields that are null. Here is an article on disabling strict mode:

http://nickbartlett.com/how-to-turn-off-mysql-strict-mode/

MySQL may need to be restarted after this change has been made.

@jsokol jsokol closed this as completed Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants