Support » Plugins » [Plugin: WP Calais Archive Tagger] Superfluous semi colon in tags

  • I get an excessive “;” after all tags created by the plugin, i.e. all posts which would otherwise be tagged “longtail” are tagged “longtail;”. I’ve looked through the code and can’t see anything wrong. It’s not in the skin either. I’m pretty puzzled by this, as I don’t think I’ve seen this before, when testing this plugin earlier. I’m also doubtful it could have anything to do with other plugins. Could it be a typo somewhere in the Calais service, perhaps?

    For the record, I use WordPress MU, but as indicated, I don’t recall this problem when using this plugin earlier.

    While writing this, the ;’s disappeared from the tags. Very strange. I’m posting this still if only to keep a record, in case others meet this strange little bug.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter mortenblaabjerg

    (@mortenblaabjerg)

    This bug still appears. Can identify no pattern. Sometimes it occurs, sometimes it doesn’t. Tags seem to be the same in the URL, without the additional “;”. Changed the thread to “not resolved”. Any clues?

    I have the same issue. I have gone through the code but can’t figure it out. Unless it has something to do with this plugin using a semi-colon as a separator instead of a comma.

    me too! will be removing manually using phpmyadmin until we can fix it…

    Thread Starter mortenblaabjerg

    (@mortenblaabjerg)

    @d910qf If you don’t mind me asking, what MySQL query do you use to remove the semi colons from your database? It should be fairly simple to add a hack to the plugin to remove them from the tags.

    Thread Starter mortenblaabjerg

    (@mortenblaabjerg)

    Yay. Created a function to get rid of the semicolons. But have to test a bit further before posting here…

    Thread Starter mortenblaabjerg

    (@mortenblaabjerg)

    Still have no deeper understanding at all of what’s happening at a deeper level, but managed to automatically remove the semicolons.

    Find the place in this plugin where it says :

    wp_set_post_tags($post->ID, implode($tags, ','));

    And replace it with this :

    $search = ";";
    $replace = "";
    if (count($tags) > 0) {
    	foreach ($tags as $key => $tag) {
            $cleantag = str_replace($search, $replace, $tag);
            $tags[$key] = $cleantag;
    	}
    }
    
    wp_set_post_tags( $post_id = $post->ID, $tags = implode($tags, ','), $append = false );

    If it doesn’t work for you, then you should remove all tags and categories from your database already infected with the semi-colons.

    This bit caused me quite a bit of trouble. I use FeedWordPress to publish posts via RSS, and every time it would just use the same tags already in place, even though I seemed to have working code. Also, since there seems to be a small bug in WordPress which makes tags and categories of the same name identical, you have to remove ‘infected’ categories too, so that your tags/categories setup is as clean as possible. I don’t think you need to remove tags or categories which are not infected with the semi-colons, but in my case it was by far the easiest to sweep the whole plate.

    PHP assistance courtesy of GingerRobot @ PHP Freaks Forums

    I had the same problem. It’s a shame since it would have saved me an immense amount of time considering I have 20,000 posts. I am moving to a different host for various reasons and the setup will be different. It will be interesting to see if WP Calais Archive Tagger give the same results. If it doesn’t, I’ll post the results between the two hosts to see if we can figure it out.

    yea have the same problem and will give your solution a go; I’ll let you know how it works out.

    FYI, I posted about this problem on the OpenCalais forum:
    http://opencalais.com/node/11332#comment-578

    This is the SQL command to tidy up the tags table and remove the ; from the tag name.

    UPDATE wp_terms SET name = replace( name, ‘;’,”)

    To fix in plugin open wp-open-calais-archive-tagger.php and change lines 142/143 to:

    $tags[] = rtrim($entity, “;”);
    $newtags[] = rtrim($entity, “;”);

    Hope this helps!

    the first code snipped seems to be working, although d910qfs seems a more elegant solution… nyeh, don’t feel like changing again 🙂

    btw, to clean up, this plugin was great:
    http://wordpress.org/extend/plugins/search-and-replace/

    although again, the simple SQL statement would look to do the job quite nicely 😀

    laters.

    Actually solution is even more simple:

    Change line 109 of opencalais.php from

    $val = trim($val);

    to

    $val = trim($val,”;”);

    That should do the trick….

    I tried both of d910qf suggestions and the

    $tags[] = rtrim($entity, “;”);
    $newtags[] = rtrim($entity, “;”);

    worked for me.

    Thanks.

    Thread Starter mortenblaabjerg

    (@mortenblaabjerg)

    Not sure if they fixed the problem at Open Calais, but now the “fixes” seem to be causing problems when removing the semi colons. Will remove the fix now and see how it goes, if it has been fixed at the source 🙂

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: WP Calais Archive Tagger] Superfluous semi colon in tags’ is closed to new replies.