Title: Invalid argument supplied for foreach() errors
Last modified: August 30, 2016

---

# Invalid argument supplied for foreach() errors

 *  Resolved [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * (@petervandoorn)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/)
 * Since updating to the latest version I’m seeing this error, but only on the backend:
 * `Warning: Invalid argument supplied for foreach() in /.../wp-content/plugins/
   advanced-access-manager/Application/Backend/Extension.php on line 87`
 * and also on line 169 when viewing /admin.php?page=aam
 * [https://wordpress.org/plugins/advanced-access-manager/](https://wordpress.org/plugins/advanced-access-manager/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [vasyl_m](https://wordpress.org/support/users/vasyl_m/)
 * (@vasyl_m)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6806801)
 * Hi **Peter**,
 * Thank you for your feedback.
 * That is kind of a weird warning, considering the fact that on the line 87 there
   is no foreach loop.
 * Please try to install AAM Utilities extension and clear all settings. This might
   help you to avoid the second warning.
 * Keep us updated.
    Regards, Vasyl
 *  Thread Starter [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * (@petervandoorn)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6806804)
 * I had thought to try the Utilities extension, but unfortunately the 2 errors 
   completely break all AAM functionality, so the Download button doesn’t work!
 * I have also already tried deleting the plugin files and reinstalling via FTP,
   but I don’t really want to try deleting it through WP as I don’t really want 
   to delete the extensive user role settings!
 *  [vasyl_m](https://wordpress.org/support/users/vasyl_m/)
 * (@vasyl_m)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6806851)
 * Hi **Peter**,
 * As a quick fix, you might try to go to database and remove the option **aam-extension-
   list** in your **wp_options** table.
 * The permanent fix is coming with our new release AAM 3.0.4 in couple days.
 * Thank you for your feedback and let me know if this works for you.
    Regards, 
   Vasyl
 *  [Studiobovenkamer](https://wordpress.org/support/users/studiobovenkamer/)
 * (@studiobovenkamer)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807068)
 * Hi Vasyl,
 * Was this problem resolved? I’m running 3.0.9 and get the same warning:
    `Warning:
   Invalid argument supplied for foreach() in ../wp-content/plugins/advanced-access-
   manager/Application/Backend/Manager.php on line 87`.
 * `Warning: Invalid argument supplied for foreach() in ../wp-content/plugins/advanced-
   access-manager/Application/Backend/Extension.php on line 180`
 * When visiting the AAM page in the admin I also get three alert pop-ups, all with
   the same warning:
    `DataTables warning: table id=role-list - Invalid JSON response.
   For more information about this error, please see http://datatables.net/tn/1`
 * Opening the extension tab, there one more warning:
    `Warning: Invalid argument
   supplied for foreach() in ../wp-content/plugins/advanced-access-manager/Application/
   Core/Repository.php on line 224`
 *  [vasyl_m](https://wordpress.org/support/users/vasyl_m/)
 * (@vasyl_m)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807069)
 * Hi **Studiobovenkamer**,
 * Please install [WP Error Fix](https://wordpress.org/plugins/wp-error-fix/) plugin
   so we can catch all your errors and provide fixes until the next AAM release 
   is ready to go.
 * Thank you,
    Vasyl
 *  [webdigit](https://wordpress.org/support/users/webdigit/)
 * (@webdigit)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807075)
 * Hi
    Same issue :/ It seems to break media manager too :s
 * Thanks a lot for the futur fix 🙂
 * JC
 *  [Dawid_W](https://wordpress.org/support/users/dawid_w/)
 * (@dawid_w)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807076)
 * Hi All. Had the same problem but solved.
    (Backup files before editing)
 * For error:
    1) Warning: Invalid argument supplied for foreach() in /…/wp-content/
   plugins/advanced-access-manager/Application/Backend/Manager.php on line 87
 * **Solution**:
    In line 87 change “foreach($list as $extension)” to “foreach((
   array)$list as $extension)”
 * 2)
    Warning: Invalid argument supplied for foreach() in /…/wp-content/plugins/
   advanced-access-manager/Application/Core/Repository.php on line 224
 * **Solution**:
    In line 224 change “foreach ($list as $row)” to “foreach ((array)
   $list as $row)”
 * 3)
    Warning: Invalid argument supplied for foreach() in /…/wp-content/plugins/
   advanced-access-manager/Application/Backend/Extension.php on line 180
 * **Solution**:
    In line 180 change “foreach($list as $extension)” to “foreach((
   array)$list as $extension)”
 * That works for me.
    Regards
 *  [vasyl_m](https://wordpress.org/support/users/vasyl_m/)
 * (@vasyl_m)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807077)
 * Hi guys,
 * Sorry for the delay. We were overloaded here with some other stuff. This issue
   will be resolved today. I’ll personally will make sure that it will.
 * Meantime please give a try to [WP Error Fix](https://wordpress.org/plugins/wp-error-fix/)
   plugin. This will allow us to get notified about PHP errors related to AAM.
 * Thank you,
    Vasyl
 *  [geleto001](https://wordpress.org/support/users/geleto001/)
 * (@geleto001)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807107)
 * Hi,
 * I have the same problem . After an updated I’ve received the same message :Warning:
   Invalid argument supplied for foreach() in /home3/geleto001/public_html/wp-content/
   plugins/post-grid/grid-items/variables.php on line 87
 * It seems that the discussion is but the problem appears again . Can you give 
   me some advice how to resolve that issue . I’ve wanted to try the Dawid_W’s solution
   but didn’t found the “foreach($list as $extension)” , so I can’t change it .
 * Thanks in advance ,

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Invalid argument supplied for foreach() errors’ is closed to new replies.

 * ![](https://ps.w.org/advanced-access-manager/assets/icon-256x256.png?rev=3447421)
 * [Advanced Access Manager – Access Governance for WordPress](https://wordpress.org/plugins/advanced-access-manager/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-access-manager/reviews/)

 * 9 replies
 * 6 participants
 * Last reply from: [geleto001](https://wordpress.org/support/users/geleto001/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-errors/#post-6807107)
 * Status: resolved