Forums

[Plugin: WP Calais Archive Tagger] Superfluous semi colon in tags (14 posts)

  1. MortenBlaabjerg
    Member
    Posted 1 year ago #

    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.

  2. MortenBlaabjerg
    Member
    Posted 1 year ago #

    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?

  3. tinkerpriest
    Member
    Posted 1 year ago #

    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.

  4. d910qf
    Member
    Posted 1 year ago #

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

  5. MortenBlaabjerg
    Member
    Posted 1 year ago #

    @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.

  6. MortenBlaabjerg
    Member
    Posted 1 year ago #

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

  7. MortenBlaabjerg
    Member
    Posted 1 year ago #

    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

  8. photolord
    Member
    Posted 12 months ago #

    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.

  9. clemmerl
    Member
    Posted 11 months ago #

    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

  10. d910qf
    Member
    Posted 11 months ago #

    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!

  11. clemmerl
    Member
    Posted 11 months ago #

    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 :D

    laters.

  12. d910qf
    Member
    Posted 11 months ago #

    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....

  13. tinkerpriest
    Member
    Posted 11 months ago #

    I tried both of d910qf suggestions and the

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

    worked for me.

    Thanks.

  14. MortenBlaabjerg
    Member
    Posted 8 months ago #

    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 :-)

Topic Closed

This topic has been closed to new replies.

About this Topic