Previous post:

Next post:

Nasty Problem With Basic Bilingual Plugin

by Stephanie Booth on 18.12.2007

in Wordpress

[fr]

Un problème avec le plugin Basic Bilingual qui fait disparaître les extraits dans "l'autre langue". Je bosse sur une solution (voir commentaires).

[en]

Heck. I just spent the last 15 minutes digging through the Google cache to retrieve “other language excerpts” which had been wiped from a good dozen of my recent posts. Not all of them, mind you — almost all of them. I haven’t yet managed to reproduce the problem, but clearly, the meta fields get reset in some circumstances.

I suspect it might be something that has to do with editing posts. Maybe related to the old disappearing tags problem?

In any case, I’m afraid Basic Bilingual must be misbehaving. Be particularly cautious when editing posts. Let me know if you have the same problem or a path to a fix — I’m working on it now.

Update: if somebody has the French excerpt to my post Advisors, Boards, Companies, Partners, Oh My! in their newsreader or browser cache, could you please send it to me or copy-paste it here as a comment? Thanks a lot.

Update, 17:30: I think I solved the problem (see comments) and corrected the files available on my server, bumping up the version to 0.31. Please download the latest version if you’re using this plugin.

Similar Posts:

{ 4 trackbacks }

Climb to the Stars (Stephanie Booth) » WordPress Deaf to Pings
18.12.2007 at 17:41
Climb to the Stars (Stephanie Booth) » November 2007 Recap
26.12.2007 at 14:17
Climb to the Stars (Stephanie Booth) » Two Plugin Updates: Basic Bilingual 0.32 and Language Linker 0.2
01.01.2008 at 18:32
Climb to the Stars (Stephanie Booth) » December 2007 Recap
18.01.2008 at 21:02

{ 8 comments… read them below or add one }

1 Stephanie 18.12.2007 at 11:00

I think I found a fix — indeed something in the “vanishing meta” department. It has something to do with comments (approving moderated comments?) but as I’m not quite sure what cause the problem, I’m not sure either how to test that it’s gone. Ugh.

2 Stephanie 18.12.2007 at 11:05

I replaced the function bb_update_meta:

// general custom field update function
function bb_update_meta($id, $field)
{
// authorization
if ( !current_user_can('edit_post', $id) )
    return $id;
// origination and intention
if ( !wp_verify_nonce($_POST['bunny-key'], 'bunny') )
    return $id;

$setting = stripslashes($_POST[$field]);
$meta_exists=update_post_meta($id, $field, $setting);
if(!$meta_exists)
{
    add_post_meta($id, $field, $setting);
}
}

Now even I can’t edit “other-excerpts” from the post editing field, so I guess it at least prevents accidents!

3 Stephanie 18.12.2007 at 11:15

Ah, this needs to go under the textarea in the admin edit post section:

// hidden field to avoid vanishing meta

echo '<input type="hidden" name="bunny-key" id="bunny-key" value="' . wp_create_nonce('bunny') . '" />';

4 Stephanie 18.12.2007 at 10:00

I think I found a fix — indeed something in the “vanishing meta” department. It has something to do with comments (approving moderated comments?) but as I'm not quite sure what cause the problem, I'm not sure either how to test that it's gone. Ugh.

5 Stephanie 18.12.2007 at 10:05

I replaced the function bb_update_meta:

<pre>// general custom field update function
function bb_update_meta($id, $field)
{
// authorization
if ( !current_user_can('edit_post', $id) )
return $id;
// origination and intention
if ( !wp_verify_nonce($_POST['bunny-key'], 'bunny') )
return $id;

$setting = stripslashes($_POST[$field]);
$meta_exists=update_post_meta($id, $field, $setting);
if(!$meta_exists)
{
add_post_meta($id, $field, $setting);
}
}
</pre>

Now even I can't edit “other-excerpts” from the post editing field, so I guess it at least prevents accidents!

6 Stephanie 18.12.2007 at 10:15

Ah, this needs to go under the textarea in the admin edit post section:

<pre>// hidden field to avoid vanishing meta

echo '<input type="hidden" name="bunny-key" id="bunny-key" value="' . wp_create_nonce('bunny') . '" />';

</pre>

7 Sudar Muthu 29.12.2007 at 18:10

Hi Stephanie,

Nice to know that you figured it out. Happy Hacking :)

8 Sudar Muthu 29.12.2007 at 17:10

Hi Stephanie,

Nice to know that you figured it out. Happy Hacking :)

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

« Back to text comment

Additional comments powered by BackType