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.

Comments (24)
  1. Everton January 24, 2007
  2. Ajay January 24, 2007
  3. Everton January 24, 2007
  4. Ajay January 24, 2007
  5. Ryan Wagner January 24, 2007
  6. Ajay January 24, 2007
  7. Everton January 24, 2007
  8. Ajay January 25, 2007
  9. gidibao January 29, 2007
  10. Kirk M January 29, 2007
  11. Mike Abundo January 29, 2007
  12. Ajay January 29, 2007
  13. gidibao January 29, 2007
  14. Ajay January 29, 2007
  15. Kirk M January 29, 2007
  16. Ajay January 29, 2007
  17. gidibao January 29, 2007
  18. Ajay January 29, 2007
  19. gidibao January 29, 2007
  20. Ajay January 29, 2007
  21. Kirk M January 30, 2007
  22. Ajay January 30, 2007
  23. Mike Abundo January 30, 2007
  24. Ajay January 30, 2007

Leave a Reply

%d bloggers like this: