Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
914 views
in Q2A Core by
edited by

This error only shows up if user has no favorites. If user have at least one favorite, favorite shows.

Notice: Undefined index: qs in /qa-include/qa-app-format.php(1452) : eval()'d codeon line 42

Warning: Invalid argument supplied for foreach() in /qa-include/qa-app-format.php(1452) : eval()'d code on line 42

It probably doesn't check if $q_list['qs'] is an array but i don't know where exactly because i am using Q2A for only 1 day.

Thanks!

Q2A version: 1.5 beta 2
by
Are you using any non standard plugins?
by
No. Error shows after fresh install.
by
I ask because the error is happening in a layer, and the only layer in the core Q2A core download is the Mouseover Layer, but that line number (42) doesn't match any reference to the 'qs' element. So please could you post the contents of your qa-plugin directory?
by
edited by
@gidgreen - you were right

it was the featured plugin - i use a lot of them but i figured it out :D

1 Answer

0 votes
by
edited by
 
Best answer

 

it was "featured" plugin 
 
There is no check for $q_list['qs']. You should change this code in the qa-featured-layer.php starting on line 41 from this:
function q_list($q_list) {
    foreach ($q_list['qs'] as $idx => $q_item)
      if($idx < $this->featured_questions)
        $q_list['qs'][$idx]['classes'] = @$q_list['qs'][$idx]['classes'].' qa-q-      list-item-featured';
      else
        break;
  qa_html_theme_base::q_list($q_list);
}
to this:
 
function q_list($q_list) {
  if(isset($q_list['qs'])){
    foreach ($q_list['qs'] as $idx => $q_item)
      if($idx < $this->featured_questions)
        $q_list['qs'][$idx]['classes'] = @$q_list['qs'][$idx]['classes'].' qa-q-list-item-featured';
      else
        break;
  }
  qa_html_theme_base::q_list($q_list);
}

 

by
FYI the final release of Q2A 1.5 (just out!) adds an empty 'qs' element on the favorites page, which should prevent this happening.
...