WordPress Wednesday: Patching UTW for WordPress 2.1

Techtites Daily: WordPress Wednesday

I still haven’t upgraded this blog to WordPress 2.1 because of a potential problem with Ultimate Tag Warrior on WordPress 2.1.
Tags would get deleted whenever a comment is added. Christine’s latest release too wasn’t able to fix the same.

082net.com has found a fix that has worked successfully for Donncha on his blog. I’ve applied the patch myself and will now be upgrading this blog to WordPress 2.1.

For those interested, modify ‘ultimate_save_tags()’ function on ‘ultimate-tag-warrior-actions.php’ about line 502:

if (isset($_POST['comment_post_ID'])) return $postID;
if (isset($_POST['not_spam'])) return $postID; // akismet fix
if (isset($_POST["comment"])) return $postID; // moderation.php fix

Update:
The above code will not solve the problem, because tags will disappear when comments are deleted or when you get a trackback. Please delete the above code changes, i.e. the last two lines of the above code.
Then around line 862, replace:

// Save changes to tags
add_action('publish_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
add_action('edit_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
add_action('save_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
add_action('wp_insert_post', array('UltimateTagWarriorActions','ultimate_save_tags'));

with

// Save changes to tags
add_action('save_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
if($wp_db_version < 3308 ) { // if lesser than WP 2.0
  add_action('publish_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
  add_action('edit_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
  add_action('wp_insert_post', array('UltimateTagWarriorActions','ultimate_save_tags'));
}

Thanks to Kirk for updating me about the changed fix. All credits for the new fix goes to 082net.com and Donncha for keeping us updated.
Also, Stephen has found an update on a bug that threw up 404 errors. It did effect me, but I hadn't given much of a thought about it.

30 Responses to “WordPress Wednesday: Patching UTW for WordPress 2.1”

  1. Everton says:

    there isn’t anything wrong with the latest release-I just checked.

  2. Ajay says:

    Did you upgrade to 2.1?

  3. Everton says:

    Yep. I checked a comment I edited this morning and the tags were still there.

  4. Ajay says:

    Interesting. Anyway, no harm patching that. I think Christine will include the same in the next version.

  5. Ryan Wagner says:

    Actually there is a problem with the latest release and the UTW website even acknowledges it. I’m not sure if someone has actually figured out exactly when it happens, but they say it occurs when pingbacks/trackbacks come in as well.

    I just implemented this fix because UTW was erasing some of the tags, so hopefully this will get me by until another release comes out.Thanks Ajay!

  6. Ajay says:

    Thanks for confirming the same too Ryan.

    Donncha confirmed to me that it is working for him properly now.

    What is your feedback so far? Still any problem?

  7. Everton says:

    Ajay, Performancing closed their ad network yesterday – you probably want to remove their banner.

  8. Ajay says:

    Thanks. Have removed the banner :)

  9. […] None of the plugins I had installed required updates right away beside Ultimate Tag Warrior which I updated and patched. I was also really glad to find that this theme was completely compatible with WordPress 2.1 It just goes to show the proficiency of Joao Craviero. That being said, if something is broken or non-functional, please let us know. […]

  10. gidibao says:

    Hello,
    thanks Ajay!
    I just implemented this fix too because UTW was erasing some of the tags when I was editing (or posting) my own comments.
    Now it works properly ;)

    cheers

  11. Kirk M says:

    You might want to check Donncha’s “The new wordpress UTW “Gotcha” post again. He’s got a new patch up for the latest UTW due to the original one (in your post) left out a couple bugs and tags were still disappearing. Donncha expalains all about it in an update and has the new patch code there as well as instructions for application.

    I updated my latest release of the UTW plugin and no initial errors. I’ll have to wait and see if the tags stay put now.

  12. Mike Abundo says:

    That UTW patch doesn’t work on trackbacks.

  13. Ajay says:

    @gidibao, You will need to update again.

    @Kirk, thanks for the update

    @Mike, the updated patch will be needed for trackbacks.

  14. gidibao says:

    Hello,
    the (new) UTW patch doesn’t work on comments editing too :(

    regards

  15. Ajay says:

    I didn’t get you? Are you saying, tags are still getting deleted?

  16. Kirk M says:

    @gidibao: I just edited one of my own comments on my blog and the tags stayed put. I’m not saying your wrong, it may be because the theme I use (LetoPrime 0.9.6) is specifically coded for UTW if it’s installed. That didn’t stop tags from disappearing before the new patch was applied though. I still need to give it a few days just to make sure.

    So far, I’ve edited comments, Akismet has caught plenty of spam and there’s been several spam trackbacks thrown into moderation by the ‘Simple Trackback Validation’ plugin that I’ve had to flush out. So far, no tag losses but I won’t say there won’t be yet. Too soon

  17. Ajay says:

    I’ve upgraded this blog as well to WP2.1. I’m gonna monitor to see if any tags end up missing.
    Hopefully they won’t!

  18. gidibao says:

    @Ajay: yes, tags are still getting deleted :(
    I agree with Kirk M (thanks) maybe the theme I use (Andreas06) do not works properly with UTW (after I’ve upgraded my blog to 2.1)… :(

    Thanks :)

    regards

  19. Ajay says:

    I’m not sure it is the theme, because all the theme does is read the tags.

    Something in UTW is giving the problem. Did the older patch work well for you?

    Maybe you can go back to it and try that out.

    Tags on this post atleast haven’t been knocked off so far even with new comments.

  20. gidibao says:

    Hi,
    no Ajay, the older patch do not works (I have tried again ten minutes ago)…

    “I do not know how” but the newest one works properly now! I have re-uploaded the same actions.php edited just a few hours ago :shock:

    thanks Ajay

    regards

  21. Ajay says:

    You’re welcome. I guess the file must have not been uploaded properly or something.

  22. Kirk M says:

    @gidibao & ajay

    Just to let you know, there are themes that are not compatible with 2.1 or should I say there are themes that are compatible. WP Codex has released a list of compatible themes here although it’s still a bit sparse (edited by bloggers and authors type of thing).

    Just info for the wise.

    I haven’t had any tag problems since I uploaded the (new) patched file. I did find that attempting to patch the actual file using manage/files editor doesn’t seem to work well in my case and I patched a local copy as you did, gidibao and FTP’d it. Then it worked fine.

  23. Ajay says:

    Correct about the compatibility Kirk, but that is WordPress compatibility. UTW compatibility is basically to display the tags.

    I never use the manage/files editor for updating. All my files don’t have write permission and always edit via FTP.

  24. Mike Abundo says:

    Hey, the new patch works! Thanks! :)

  25. Ajay says:

    You’re welcome Mike

  26. […] WordPress Wednesday: Patching UTW for WordPress 2.1 » Techtites This is the patch need for UTW for wordpress 2.1 (tags: wordpress plugin) […]

  27. […] has been running a thread about UTW and WordPress 2.1 issues. I initially decided that until someone confirms that UTW is safe to run with WordPress 2.1 I was […]

  28. […] a new release, though there is a fix from Donnch O’Caoimh and another version of the fix from Techtites to get it working with WordPress […]

  29. […] うちのWPは全部2.1なので実はUTWに問題があったようです。2.1じゃなければ関係ないけど。 UTWのパッチがでているようなので修正してみました。 参考サイト: WordPress Wednesday: Patching UTW for WordPress 2.1 » Techtites […]

Leave a Reply

%d bloggers like this: