Greta 2 [en]

[fr] Exercice d'écriture: personnage Greta.

She left Greta on a Tuesday, and she needs to fill in her week before she meets up with Sam on Sunday evening. It doesn’t have to be tricky. The nice thing about writing stories is that you can choose to skip telling parts of it. You can compress or zoom in, whenever you feel like it.

The next day, the kiosk is still closed. And the day after. On Friday, Greta expects it to be closed, and files the fact away in the “let’s not worry about this” part of her brain. The Selecta machine at the station will have to do for her sugar fix, and she’ll remember to buy cigarettes at the other end of her train journey as she heads home. She misses the interaction with the kiosk lady, though.

Saturday is spent marking tests and preparing classes while Raphaël goes for a run and sees some of his friends. His friends are OK, but she doesn’t feel particularly close to them, and they realized early on in their relationship there was no sense in trying to force their respective social lives onto each other when things didn’t click.

So on Saturdays, Raph goes off and Greta gets some extra quiet working time. He shops for groceries on the way home, cooks dinner, and then they have an evening to themselves. Sometimes they go out for a movie, but most of the time they stay in. Greta used to hang out at Captain Cook’s a lot when she was still seeing Sam, but bars aren’t really Raph’s cup of tea, so she stopped going.

She’s having an evil thought right now. What if she made the Cook disappear for Sophie? Would she manage to reconcile that with the rest of the story? Could she have, in the same story, Sam with a missing Great Escape, Sophie with a missing Captain Cook, and Greta with a missing kiosk? The Great Escape seems to be missing for everybody — it would be hard to make the Captain Cook disappear for everybody as Sam and Sophie and Robert just spent the evening there but… Who knows? That would be really twisted.

Sunday is Raph and Greta’s day together. There’s not much to do on Sundays in Lausanne except hang out and spend some quality time together. It’s a quiet day. Greta likes quiet, now. Actually, that was one of the problems with Sam — he always had to be out and about.

She’s at the point now where she keeps going back and re-reading what she’s already written about Greta and Sam, to make sure she doesn’t say anything contradictory. For example, she’s decided Sam was always out and about, but what has she said about that earlier? Actually, she sees that she’s written that Sam ate out a lot. Compatible. She’s happy with how this is going.

She doesn’t think about Sam that often anymore. It was hard when they broke up, but time has passed and she’s really happy with Raphaël. It’s a much better relationship — at times she wonders why on earth she and Sam stuck together for so long when things were obviously so difficult. She knows Sam has had a harder time getting over their relationship. To her knowledge, he hasn’t moved on to anything else yet. She might be mistaken, though. They barely talk anymore.

So, she’s a little surprised when Sam calls her up on Sunday evening.

“Hi Greta, how are you doing?”
“Hey, Sam! Haven’t heard from you in ages…”
“Yeah, well…”
“I’m good — busy with work, you know, but overall everything is fine. What about you?”
“Well, listen… I know this may sound a bit odd, but would you mind coming over to Café de la Place for a coffee?”
Greta is a bit taken aback. “Why, what’s up?”
“I’d rather talk about in person. Could you be there in 30 minutes or so?”
“Sure.” She’s a bit worried. “Are you OK?”
“Yeah, pretty much. I’ll explain when I see you. Thanks.”

Greta is not very enthusiastic about dragging herself out of her cozy flat to have coffee with her ex when she starts school early the next day. But she still does care for Sam, and knows he wouldn’t ask this of her if it weren’t important for him. He didn’t sound that good on the phone, either.

She promises Raphaël she’ll be back as soon as she can, and catches the bus to Sam’s and Café de la Place.

Invalid argument supplied for foreach() in wp-capabilities.php: Case Cracked! [en]

[fr] Le problème avec wp-capabilities.php qui fait qu'on peut se retrouver "exfermé" (enfermé dehors) de son blog WordPress (typiquement en cas de changement de serveur) semble avoir sa source dans le contenu du champ wp_user_roles dans la table wp_options. En particulier, pour la version française, "Abonné" est un rôle d'utilisateur, et en cas de problèmes d'encodage MySQL, le caractère accentué sera corrompu, causant ainsi l'erreur.

Il suffit de remplacer le caractère fautif dans PhpMyAdmin, et on retrouve l'accès à son blog. Bon, reste ensuite à régler les questions d'encodage... mais c'est déjà ça!

Finally. At last. Endlich. Enfin.

Once more, while trying to transfer a WordPress installation from one server to another, I found myself facing the dreaded problem which locks me out of my WordPress install with a rather cryptic message:

Warning: Invalid argument supplied for foreach() in /home/user/wp/wp-includes/capabilities.php on line 31

(Your lineage may vary.)

What happens is that WordPress cannot read user roles, and therefore, even though your password is accepted, you get a message telling you that you’re not welcome in the wp-admin section:

Vous n’avez pas les droits suffisants pour accéder à cette page.

Or, in English:

You do not have sufficient permissions to access this page.

A quick search on the WordPress forums told me that I was not alone in my fight with wp-capabilities.php, but that many problems had not been resolved, and more importantly, that suggested solutions often did not work for everyone.

I’ve bumped into this problem a couple of times before, and I knew that it was linked to encoding problems in the database. (I’ve had my share of encoding problems: once, twice, thrice — “once” being on of the most-visited posts on this blog, by the way, proof if needed that I’m not alone with mysql encoding issues either.)

I’ll leave the detailed resolution of how to avoid/cure the MySQL problems later (adding
mysql_query("SET NAMES 'utf8'");
to wp-db.php as detailed in this thread, and as zedrdave had already previously told me to do — should have listened! — should prevent them). So anyway, adding that line to my working WordPress install showed me that the problem was not so much in the database dumping process than in the way WordPress itself interacted with the database, because the dreaded wp-capabilities.php problem suddenly appeared on the original blog.

Now, this is where I got lucky. Browsing quickly through the first dozen or so of forum threads about wp-capability.php problems, this response caught my eye. It indicated that the source of the problem was the content of the wp_user_roles field (your prefix may vary). In this case, it had been split on more than one line.

I headed for the database, looked at the field, and didn’t see anything abnormal about it at first. All on one line, no weird characters… just before giving up, I moved the horizontal scrollbar to the end of the line, and there — Eurêka! I saw it.


“Contributor”, in French, is “abonné”, with an accent. Accent which got horribly mangled by the MySQL problems which I’ll strive to resolve shorty. Mangled character which caused the foreach() loop to break in wp-capabilities.php, which caused the capabilities to not be loaded, which caused me to be locked out of my blog.

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.

Good luck!