Forums

WP Error? (Help) (10 posts)

  1. tamzarian
    Member
    Posted 3 years ago #

    Hi everyone, I have recently installed WP 2.0 on a new site. No upgrades, just a normal install. At the top of my page it says "Warning: Invalid argument supplied for foreach() in /home/waterblo/public_html/wp-includes/capabilities.php on line 19" What does this mean? How can I fix it?

    Thank you!

    EDIT: It seems that I cant login to the admin section! This is the error I get, "Warning: Invalid argument supplied for foreach() in /home/waterblo/public_html/wp-includes/capabilities.php on line 19

    Warning: Cannot modify header information - headers already sent by (output started at /home/waterblo/public_html/wp-includes/capabilities.php:19) in /home/waterblo/public_html/wp-includes/pluggable-functions.php on line 177"

  2. moshu
    Member
    Posted 3 years ago #

  3. jaredquinn
    Member
    Posted 3 years ago #

    You may want to keep an eye on this one:

    http://wordpress.org/support/topic/55710

    It seems to be the same problem.

  4. jaredquinn
    Member
    Posted 3 years ago #

    You can try changing line 19 of capabilities.php to:


    foreach ((array)$this->roles as $role => $data) {

    The interesting thing here is that I don't have a prefix_user_roles table (on my 2.0 database), which is where this particular function reads data from??

  5. tamzarian
    Member
    Posted 3 years ago #

    Well, thanks for the help. I tried to fix it, but the error just jumps lines on me. I think it has something to do with this:($this->roles as $role => $data) its on line 19, currently, its deleted from it (I took it out in an attempt to fix it). If anyone can help, thanks alot!!

    EDIT: I didnt see all the posts everyone made, let me try those. If it doesn't work, I'll post back again.

    2nd EDIT: jaredquinn, THANKS! I got it to work now, the error is gone. A new one has come up though! When I try to login to the admin page, it says I do not have sufficient permissions! I am logging in with the correct password to my admin account. If anyone can help, triple thanks!

  6. jaredquinn
    Member
    Posted 3 years ago #

    If you have a wp_user_roles table try renaming it to something else, I don't have one on my 2.0 install, yet the file you're getting these errors in does seem to query one (and gracefully exit if it doesn't have one)

  7. jaredquinn
    Member
    Posted 3 years ago #

    If you try the above you should backout the last thing I suggested too.

  8. tamzarian
    Member
    Posted 3 years ago #

    Where would this file be? I am currently loading a backup (yesterdays). If it doesn't work, I'll have to look for that file. Thanks for all the help, I really appreciate it.

  9. jaredquinn
    Member
    Posted 3 years ago #

    Sorry it is (could be) a database table...

  10. tamzarian
    Member
    Posted 3 years ago #

    OK, I will be sure to look for that. Thanks again! (Still loading the backup :|)

    EDIT: I got it to work, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags