Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
8.8k views
in Themes by
edited by
I get this with donut theme on the 1371 and 243 lines at qa-theme/donut-theme/qa-donut-layer.php any ideas? Using php 7.2

243-246
if ( count( $sub_navigation ) ) {
                // create the left side bar
                $this->left_side_bar( $sub_navigation );
            }

1371-1373
  if ( count( @$this->content['widgets'][$region][$place] ) ) {
                $col = ( $region == 'full' ) ? ' col-xs-12' : '';

PHP Notice:  Undefined index: style in
               $style = $form['style'];

                       $this->output('<table class="qa-form-' . $form['style'] . '-table">');

                     $columns = ($form['style'] == 'wide') ? 2 : 1;
Q2A version: 18

1 Answer

+2 votes
by
selected by
 
Best answer

The variable passed to the count() function must be an array. In PHP 7.2 it gives a warning now.

Solution would be to change it to

if (is_array($sub_navigation) && count($sub_navigation)) {

and

if (isset($this->content['widgets'][$region][$place]) && count($this->content['widgets'][$region][$place])) {
by
Scott thank you for your quick response. I really appreciate it, seems to be working.
by
Scott, do you think you could help me with those 3? Ether ways thank you for your help.

PHP Notice:  Undefined index: style in
               $style = $form['style'];

                       $this->output('<table class="qa-form-' . $form['style'] . '-table">');

                     $columns = ($form['style'] == 'wide') ? 2 : 1;
by
You probably need something like this:

 $style = isset($form['style']) ? $form['style'] : 'tall';

And then replace $form['style'] with $style

You should probably get in contact with the developer of the theme so they can fix the problems for everyone else too.
...