Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

I have PHP notice after editing a question.

+3 votes
asked Jul 26, 2013 in Q2A Core by mih1406
Here is the notice:

Notice: Undefined index: categoryid in ..../qa-include/qa-page-question-post.php on line 479
Q2A version: 1.6.1

1 Answer

+1 vote
answered Jul 28, 2013 by gidgreen

Thanks for this. You should be able to fix it by modifying qa-page-question-post.php as follows:

if (strcmp($in['categoryid'], $question['categoryid']))

... to ...

if (array_key_exists('categoryid', $in) && strcmp($in['categoryid'], $question['categoryid']))

Once you confirm this workrs the fix will be rolled into 1.6.2.

commented Jul 28, 2013 by mih1406
I will try to test it, but what about the index 'categoryid' in the array $question. I think it needs to be checked too?!
commented Jul 29, 2013 by gidgreen
No, it should always be there.