• Resolved Levethix

    (@levethix)


    Getting these errors after upgrading today. Upgraded to 2.8.1.

    I tried doing a full removal and re-install but that didn’t help any.

    Warning: Invalid argument supplied for foreach() in /home/XXX/wordpress/wp-content/plugins/file-away/lib/cls/class.fileaway_utility.php on line 328

    Warning: Invalid argument supplied for foreach() in /home/xxx/wordpress/wp-content/plugins/file-away/lib/cls/class.fileaway_utility.php on line 328

    Warning: Invalid argument supplied for foreach() in /home/xxx/wordpress/wp-content/plugins/file-away/lib/cls/class.fileaway_utility.php on line 328

    Warning: Cannot modify header information – headers already sent by (output started at /home/xxx/wordpress/wp-content/plugins/file-away/lib/cls/class.fileaway_utility.php:328) in /home/xxx/wordpress/wp-includes/option.php on line 747

    Warning: Cannot modify header information – headers already sent by (output started at /home/xxx/wordpress/wp-content/plugins/file-away/lib/cls/class.fileaway_utility.php:328) in /home/xxx/wordpress/wp-includes/option.php on line 748

    https://wordpress.org/plugins/file-away/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author thomstark

    (@thomstark)

    OK. Thanks, I’ll get you a fix real quick here.

    Plugin Author thomstark

    (@thomstark)

    Ah, you must have a user role that doesn’t have any capabilities. I’ll add a check real quick.

    Plugin Author thomstark

    (@thomstark)

    I’ve already updated the class.fileaway_utility.php file on the repository with the fix, but I want to make sure it works for you before pushing a new version update. So you can either redownload and install, or make the change yourself:

    Navigate to wp-content/plugins/file-away/lib/cls/

    and open up class.fileaway_utility.php

    Scroll down to almost the very bottom and replace the whole

    public static function caps()
    {
    // and all the stuff inside
    }

    with this:

    public static function caps()
    {
    $roles = new WP_Roles;
    $a = array();
    $b = array();
    foreach($roles->roles as $role => $name) $a[$role] = $role;
    foreach($roles->roles as $role)
    {
    if(isset($role[‘capabilities’]) && is_array($role[‘capabilities’]))
    {
    foreach($role[‘capabilities’] as $cap => $bool) if(strpos($cap, ‘level_’) === false) $b[$cap] = $cap;
    }
    }
    if(count($b) > 0) ksort($b);
    $caps = array_unique(array_merge($a, $b));
    return $caps;
    }

    Let me know if that resolves it for you.

    Thread Starter Levethix

    (@levethix)

    That did it. Thank you so much for the prompt assistance!

    Plugin Author thomstark

    (@thomstark)

    Good deal. No problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Warning: Invalid argument supplied for foreach()’ is closed to new replies.