q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 628 forks source link

Unable to add category as superadmin #898

Closed mehmetyavuz123 closed 1 year ago

mehmetyavuz123 commented 3 years ago

I made a site by questions2answer.

But, when I try to add new category as superadmin, I receive HTTP ERROR 500.

I try all alternatives but I can't solve this problem.

What should I do?

thanks in advance.

pupi1985 commented 3 years ago

What do the error logs say? Exactly what link have you used to download Q2A? (Default one uses a testing branch)

mehmetyavuz123 commented 3 years ago

I downloaded latest Q2A from https://github.com/q2a/question2answer/releases.

Error logs are:

"This page isn’t working, avukatasorular.com is currently unable to handle this request. HTTP ERROR."

pupi1985 commented 3 years ago

That's the error displayed to the user. It doesn't say anything. What does the web server's error log say?

mehmetyavuz123 commented 3 years ago

It says:

Failed to load resource: the server responded with a status of 500 () chrome-error://chromewebdata/:1

mehmetyavuz123 commented 3 years ago

Need another information?

mehmetyavuz123 commented 3 years ago

Please help me

mehmetyavuz123 commented 3 years ago

Is there anyone to help me?

mehmetyavuz123 commented 3 years ago

Also, these logs are displayed:

crbug/1173575, non-JS module files deprecated. (index):7146. No resource with given URL found.

mehmetyavuz123 commented 3 years ago

Is there anyone to help me?

marcoscgfilho commented 3 years ago

Steps to reproduce

What is the current bug behavior?

After clicking "Add Category" a 500 error is displayed.

What is the expected correct behavior?

After clicking "Add Category" the user should be able to create a category.

Relevant logs

[Thu Aug 05 16:45:00.886613 2021] [php:notice] [pid 13] [client 172.19.0.1:44788] PHP Fatal error:
Uncaught ValueError: max(): Argument #1 ($value) must contain at least one element in /question2answer/qa-include/pages/admin/admin-categories.php:483
Stack trace:
#0 /question2answer/qa-include/pages/admin/admin-categories.php(483): max()
#1 /question2answer/qa-include/app/page.php(183): require('...')
#2 /question2answer/qa-include/qa-base.php(752): qa_get_request_content()
#3 /question2answer/qa-include/qa-base.php(814) : eval()'d code(1): qa_call()
#4 /question2answer/qa-include/qa-base.php(720) : eval()'d code(70): qa_get_request_content_base()
#5 /question2answer/qa-include/qa-base.php(752): qa_get_request_content_override_1_in_overrides_php()
#6 /question2answer/qa-include/qa-base.php(817): qa_call()
#7 /question2answer/qa-include/app/page.php(174): qa_call_override()
#8 /question2answer/qa-include/qa-page.php(47): qa_get_request_content()
#9 /question2answer/qa-include/qa-index.php(188): require('...')
#10 /question2answer/index.php(27): require('...')
#11 {main}
  thrown in /question2answer/qa-include/pages/admin/admin-categories.php on line 483, referer: http://localhost:8089/index.php/admin/categories
Component Version
Question2Answer 1.8.6 (build date 2021-04-20)
PHP 8.0.9
MySQL 8.0.23
pupi1985 commented 3 years ago

Things are much easier with error logs :) The fix should be here: #911

marcoscgfilho commented 3 years ago

Thanks, @pupi1985. You're the best. Just tested here and it's working fine now. :)

EliasPereirah commented 3 years ago

Was this fix? I am have the same problem. I am using the last version

pupi1985 commented 3 years ago

I've created the pull request with the fix but it has not been merged. You can apply the changes in #911 manually

EliasPereirah commented 3 years ago

Thanks. It work

update20221 commented 2 years ago

how to solved