Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

bencomp on "Invalid argument supplied for foreach() in .. polylang/include/mo.php on line 57"

$
0
0

I updated to 1.2.1 recently. All looked okay from the plugin update screen and I didn't look at my site after the update.
Now that I do, I see a warning at the top of each page|post|index:

Invalid argument supplied for foreach() in /var/www/vhosts/companjen.name/subdomains/ben/httpdocs/wp-content/plugins/polylang/include/mo.php on line 57

The homepage http://ben.companjen.name is unavailable because of this warning ("headers already sent"); if I append "/nl" or "/en", the languages that I use, I do get the respective homepages.

From looking at the code, the line causing the warning is in import_from_db($lang):
foreach (unserialize($post->post_content) as $msg). Could there be something wrong in the database causing unserialize to go "can't do that"?

In the database I notice inconsistent values for _translations keys:
(post 346) s:37:"a:2:{s:2:"nl";i:346;s:2:"en";s:0:"";}";
(post 359) a:2:{s:2:"nl";s:3:"359";s:2:"en";s:1:"0";}
(post 733) a:2:{s:2:"nl";s:3:"733";s:2:"en";s:1:"0";}
(post 765) a:2:{s:2:"en";i:765;s:2:"nl";i:0;}

The first one is off, and I don't know why. The last one is again different. Is this causing trouble?

Most noticeable, though, is that all posts with type "image" have no language information anymore when looking at the posts overview.
What can I do? Normalise the database values?

http://wordpress.org/plugins/polylang/


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>