Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.1k views
in Plugins by

hi

when i click on , on site notification (q2apro.com plugin)  with admin users

i get this error :

Question2Answer fatal error:

 
User ID could not be found: 612
 
Stack trace:
 
require() in index.php:31
require() in qa-index.php:175
qa_get_request_content() in qa-page.php:789
qa_call_override() in qa-page.php:198
qa_call() in qa-base.php:579
qa_get_request_content_override_1_in_qa_poll_overrides_php() in qa-base.php:532
qa_get_request_content_base() in qa-base.php(510) : eval()'d code:12
qa_call() in qa-base.php(577) : eval()'d code:1
qa_get_request_content() in qa-base.php:532
require() in qa-page.php:219
process_request() in qa-page-default.php:108
qa_post_userid_to_handle() in q2apro-onsitenotifications-page.php:130
 
 
Q2A version: 1.6.3

1 Answer

0 votes
by

That is the core throwing an error instead of an exception. The core has been modified not to throw that error in v1.7 but as you're using 1.6.3 you are still getting it. Glancing at the plugin's code, maybe you could check if the users really exist or not in the query itself.

1. Locate this line: https://github.com/q2apro/q2apro-on-site-notifications/blob/61c987b362081c747b1a7665fe58365471b2b726/q2apro-onsitenotifications-page.php#L95

2. ABOVE the WHERE line clause add this line:

JOIN ^users u ON e.userid = u.userid

I haven't tested but it should work. Let me know if it does.

by
i try it
but still its not working :(
by
I would have expected that to fix the issue. Hmm... I assume you're still getting the SAME error, otherwise you would have mentioned it.

Then you can either hack the core (as this has already been removed in 1.7): https://github.com/q2a/question2answer/blob/v1.6.3/qa-include/qa-app-posts.php#L345

Replacing 4 lines from 345 to 348 with only this one:

return is_array($user) ? $user['handle'] : null;

Or just update to the v1.7.0 which has just been released!  :D
...