Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.7k views
in Q2A Core by

While searching something on my q2a website, I encountered a notice on top area of header. The notice says

Notice: Undefined index: postid in /home3/name/public_html/my_site.com/qa-plugin/q2am-star-ratings/q2am-star-ratings-process.php on line 60

Can someone tell me that what is this and how can I fix this problem. So that it won't show in future.

Q2A version: 1.6.3

6 Answers

+1 vote
by
selected by
 
Best answer

I've proposed a fix to the plugin owner. Check the simple change here and let us know if you still get that notice.

BTW, I guess the easy way to test this would be to go to your profile and save it. That should fire an event that does not have a 'postid'.

Edit:

Whoops. Corrected previous commit here. I missed the curly braces.

by
I'm really sorry I have overlook this fix you send me. I will update it soon as possible.  Thanks for your contribution.
by
Don't worry, there is no issue, just a notice in the server log. Take your time :)
by
moved by
Thanks a lot pupi1985, the problem has been resolved.
+1 vote
by
It's a problem with the star ratings plugin. Look at the file and line given in the error.
+1 vote
by

I opened the named file and saw that line but couldn't figure out what is the problem. Below is a screenshot of that file with the mentioned line.

 

See if you can help me by having a look at the pic.

+1 vote
by

After doing what pupi1985 said, the following error shows up while searching anything and even while loggig in and logging out.


Notice: Undefined variable: post_id in/home3/name/public_html/my_site.com/qa-plugin/q2am-star-ratings/q2am-star-ratings-process.php on line 65

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.

 

by
Folks I'm busy in some shifting and so will get internet coming weekend. After that I will look in to the issue. Meantime if anyone find the fix. Feel free to fork on github and send me pull request. I would thankful.
by
My bad. I didn't add curly brackets to the IF statement. Check here:https://github.com/pupi1985/q2am-star-ratings/commit/a1dbe4cc90e7d235f410937616e9fe6cbb717d07
0 votes
by

Getting error on each question -

Notice: Object of class mysqli_result could not be converted to int in /home4/mgghu/public_html/www.lawhelpline.org/qa-plugin/q2am-star-ratings/q2am_star_ratings_class.php on line 62
 

+1 vote
by
i got same error but done, even i modifed these lines in file -> q2a-star-rating-process.php

        if($event == 'q_post' || $event == 'a_post') {
            $post_id = $params['postid'];

please help me to get rid of this error..
...