Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
512 views
in Q2A Core by
When a user tries to register, i get error on question2answer to check webserver logs.

 

A Question2Answer database query failed when generating this page.

A full description of the failure is available in the web server's error log file.

in the logs, the error is

 

2015/01/14 15:11:13 [error] 44771#0: *3147 FastCGI sent in stderr: "PHP message: PHP Question2Answer MySQL query error 1048: Column 'content' cannot be null - Query: REPLACE qa_userprofile (title, content, userid) VALUES ('operating-system', NULL, '6')" while reading response header from upstream, client: 173.245.51.213, server: www.qa.appuals.com, request: "POST /register?to= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "qa.appuals.com", referrer: "http://qa.appuals.com/"
2015/01/14 15:24:18 [error] 44769#0: *3735 FastCGI sent in stderr: "PHP message: PHP Question2Answer MySQL query error 1048: Column 'content' cannot be null - Query: REPLACE qa_userprofile (title, content, userid) VALUES ('operating-system', NULL, '7')" while reading response header from upstream, client: 173.245.51.213, server: www.qa.appuals.com, request: "POST /register?to= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "qa.appuals.com", referrer: "http://qa.appuals.com/"
Q2A version: latest
by
I don't see any error on your site. Was it a theme issue as I explained?

1 Answer

+1 vote
by

The technical issue is pretty obvious: you're trying to put a null value in a non-null field. With that amount of information I can only tell you it is a theme, plugin or a core hack issue.

After taking a look at your site, I noticed you're using CleanStrap theme, which has been reported to have some yet unsolved issues. So my guess is it is related to it. Maybe that theme can't handle the display of the extra user fields in registration, so you added the "Operating System" field, checked the checkbox to show it in registration and then the theme is not displaying it so you end up not submitting a field and the core is trying to insert an absent value.

If that is the cause of the issue then you can avoid it by:

  • Fixing the theme (doing so yourself or asking the developer)
  • Unchecking the "Show field on user registration form" in the field settings under admin/users
Did I hit the nail?
...