• Resolved Kooyaya

    (@kooyaya)


    Updated to latest version 1.16.26 and started get this error:

    PHP Notice: Undefined variable: table_data in <wp_dir>/wp-content/plugins/updraftplus/backup.php on line 2086
    PHP Warning: count(): Parameter must be an array or an object that implements Countable in <wp_dir>/wp-content/plugins/updraftplus/backup.php on line 2086

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor bcrodua

    (@bcrodua)

    Hi,

    Can you try to re-install the plugin? Make sure you download a fresh copy of the plugin (https://wordpress.org/plugins/updraftplus/).

    Regards,
    Bryle

    Thread Starter Kooyaya

    (@kooyaya)

    How can re-installation help fix the bug? Have you check your code around the line in error message? It’s obvious!

    The $table_data used at line 2086 and 2091 is not defined when the if-statement in line 1998 is false, since the $table_data is only defined within the if block. The code is as below:

    if ('VIEW' != $table_type) {
      ......
      $table_data = ......
    }
    
    $next_page = (-1 == $process_pages || 0 == count($table_data)) ? 'finished' : (int) ($row_start / $row_increment);

    If I read the code correctly, the plugin breaks if there is a view in the database

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    Apologies for the delay.

    This has been addressed in our current development version, and will be fixed in the next release.

    If you wish to stop the warnings, you can add the following to line 1997 (just above the if block):
    $table_data = array();

    • This reply was modified 3 years, 9 months ago by DNutbourne.
    Thread Starter Kooyaya

    (@kooyaya)

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Undefined variable: table_data in updraftplus/backup.php’ is closed to new replies.