DISQUS

Climb to the Stars: Invalid argument supplied for foreach() in wp-capabilities.php: Case Cracked!

  • Xavier · 2 years ago

    Mmmh, would say me changing the translation file to say "Abonné" instead of "Abonné" would solve the problem for future generations ?

  • Stephanie · 2 years ago

    It would. eacute. What would also solve the problem would be adding that utf-8 line in wp-db.php. Will try to catch the WP people about that.

  • Xavier · 2 years ago

    MO file : done, for both 2.0.7 & 2.1 (both utf-8 & iso-8859-1).
    Let me know - if you still reproduce de problem.


    Also, try to file a bug report to the Trac (free registration ! ;) )
    http://trac.wordpress.org/timeline</p>

  • Xavier · 2 years ago

    Pfioulala, je pense trop vite pour mes doigts. Donc, pour la totale : +you, +can, s/de/the/ :)

  • Lloyd Budd · 2 years ago

    It is a good solution if you use UTF8, but not everyone is. WordPress core seems to need a more comprehensive solution.

  • David Touvet · 2 years ago

    Salut Steph'
    j'ai eu également une l'erreur suivante en upgradant à la version WP 2.1


    Fatal error: Call to undefined function: wp_get_current_user() in /home/cybexpor/public_html/wp-includes/capabilities.php


    Ca ressemble un peu à ton erreur. Ce qui m'a sauvé fut simplement de reuploader sur le serveur le répertoire wp-includes...


    A jeudi!
    david

  • Zomp · 2 years ago

    Many thanks, you helped me very much!

  • N. Naci Kisnisci · 2 years ago

    Thank you for solution and sharing

  • Andrew · 1 year ago

    As a total n00b to WP and PHP I cannot tell what in my table might be causing this problem. I've managed to dig this up from PHPMyAdmin; I think it is the correct field:


    a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:48:{s:13:"switch_themes";i:1;s:11:"edit_themes";i:1;s:16:"activate_plugins";i:1;s:12:"edit_plugins";i:1;s:10:"edit_users";i:1;s:10:"edit_files";i:1;s:14:"manage_options";i:1;s:17:"moderate_comments";i:1;s:17:"manage_categories";i:1;s:12:"manage_links";i:1;s:12:"upload_files";i:1;s:6:"import";i:1;s:15:"unfiltered_html";i:1;s:10:"edit_posts";i:1;s:17:"edit_others_posts";i:1;s:20:"edit_published_posts";i:1;s:13:"publish_posts";i:1;s:10:"edit_pages";i:1;s:4:"read";i:1;s:8:"level_10";i:1;s:7:"level_9";i:1;s:7:"level_8";i:1;s:7:"level_7";i:1;s:7:"level_6";i:1;s:7:"level_5";i:1;s:7:"level_4";i:1;s:7:"level_3";i:1;s:7:"level_2";i:1;s:7:"level_1";i:1;s:7:"level_0";i:1;s:17:"edit_others_pages";i:1;s:20:"edit_published_pages";i:1;s:13:"publish_pages";i:1;s:12:"delete_pages";i:1;s:19:"delete_others_pages";i:1;s:22:"delete_published_pages";i:1;s:12:"delete_posts";i:1;s:19:"delete_others_posts";i:1;s:22:"delete_published_posts";i:1;s:20:"delete_private_posts";i:1;s:18:"edit_private_posts";i:1;s:18:"read_private_posts";i:1;s:20:"delete_private_pages";i:1;s:18:"edit_private_pages";i:1;s:18:"read_private_pages";i:1;s:12:"delete_users";i:1;s:12:"create_users";i:1;s:17:"unfiltered_upload";i:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";i:1;s:17:"manage_categories";i:1;s:12:"manage_links";i:1;s:12:"upload_files";i:1;s:15:"unfiltered_html";i:1;s:10:"edit_posts";i:1;s:17:"edit_others_posts";i:1;s:20:"edit_published_posts";i:1;s:13:"publish_posts";i:1;s:10:"edit_pages";i:1;s:4:"read";i:1;s:7:"level_7";i:1;s:7:"level_6";i:1;s:7:"level_5";i:1;s:7:"level_4";i:1;s:7:"level_3";i:1;s:7:"level_2";i:1;s:7:"level_1";i:1;s:7:"level_0";i:1;s:17:"edit_others_pages";i:1;s:20:"edit_published_pages";i:1;s:13:"publish_pages";i:1;s:12:"delete_pages";i:1;s:19:"delete_others_pages";i:1;s:22:"delete_published_pages";i:1;s:12:"delete_posts";i:1;s:19:"delete_others_posts";i:1;s:22:"delete_published_posts";i:1;s:20:"delete_private_posts";i:1;s:18:"edit_private_posts";i:1;s:18:"read_private_posts";i:1;s:20:"delete_private_pages";i:1;s:18:"edit_private_pages";i:1;s:18:"read_private_pages";i:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";i:1;s:10:"edit_posts";i:1;s:20:"edit_published_posts";i:1;s:13:"publish_posts";i:1;s:4:"read";i:1;s:7:"level_2";i:1;s:7:"level_1";i:1;s:7:"level_0";i:1;s:12:"delete_posts";i:1;s:22:"delete_published_posts";i:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:6:{s:10:"edit_posts";i:1;s:20:"edit_published_posts";i:1;s:4:"read";i:1;s:7:"level_1";i:1;s:7:"level_0";i:1;s:12:"delete_posts";i:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";i:1;s:7:"level_0";i:1;}}}


    Does anyone know if I am looking at the right thing, and if so, what might the actual problem be? I don't see any mangled characters.


    Thanks to anyone who can help.


    Andrew

  • Andrew · 1 year ago

    ah I see my row is not wrapping - sorry. I don't see anything that looks wrong in it but will keep at it. If I find anything will post here and on the WP forums.

  • Christian · 1 year ago

    Thank you, thank you, thank you! The User roles area was where I was having troubles.


    Cheerful Trails,


    Christian

  • Aoife · 1 year ago

    You are a life saver, thank you! I looked for hours and even my hosting company was not able to help... now it's fixed!

  • Yedidia · 1 year ago

    you guys are much too good for me.


    "So, in summary: if you’re locked out of your blog and get a warning/error about wp-capabilities and some invalid foreach() loop thingy, head for PhpMyAdmin, and look carefully through the wp_user_roles field in the wp_options table. If it’s split over two or more lines, or contains funky characters, you have probably found the source of your problem."


    so it is scrambled (abonné). what should I do?

  • Yedidia · 1 year ago

    Bon, j'avoue, j'ai paniqué. Donc je ne suis plus exfermée sur mon blog. Y a-t-il une manière simple de modifier tous les caractères "scramblés" sur mon blog?
    D'autant que j'en ai d'autres à upgrader , et autrement plus verbeux.
    Merci de m'avoir fourni la solution, quand même...

  • Tamer Salama · 1 year ago

    PHP initial configuration values should be as follows:


    magic_quotes_runtime = off;
    magic_quotes_gpc = off;
    register_globals = on;


    via:
    http://wordpress.org/support/topic/122367</p>