(Later – Scroll to the end of this post for a small patch to fix the problem with disappearing tags!)
As seen elsewhere and of course on the official blog, WordPress 2.1 was released to much fanfare yesterday.
It works great, I’ve been using the development version on my blogs for quite a while now and until recently it worked swimmingly. It still does, but some time in the last 2 weeks Ultimate Tag Warrior stopped working properly. Whenever someone made a comment on a post the tags on that post would be deleted. It’s gotten so bad now that I’m moderating all comments, and opening those posts in the editor before approving the comments.
A half-way fix is available but moderated comments will still delete the tags so once I verify that the fix does what it does comment moderation will go back to the way it was before.
You should upgrade WP-Cache to the new 2.0.22 release too. It fixed problems I was seeing here with comments and posts not showing up until I deleted the cache manually. Yay!
If you’re interested, a new WordPress MU release will follow in a day or so. More here.
I forgot to mention, do I recommend you upgrade to WordPress 2.1? Yes. If you run a site that is in any way popular your database server will thank you. WordPress uses the MySQL query cache in a much more efficient manner than ever before when reading posts. Make sure your query cache is activated and tweak it until you hit the sweet spot. It’ll make a big difference when your server is under load.
Fix Fix Fix!
HandySolo spotted a simple fix for the tag problem! Check out the thread on this post and scroll to the entry by 082net.com where he outlines a simple fix for the disappearing tag problem. I just tried it and it works!
Here’s a temporary patch for resetting tags.
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
Even with the fix above, deleting a comment will delete the tags, and sending a trackback/pingback will do the same. 082net.com fixed that too. You can remove the above fix and apply the following.
Around line 862 of ultimate-tag-warrior-actions.php find the following chunk of code:
// 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'));
Replace that code 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'));
}
PS. Stephen Spencer has discovered why UTW doesn’t always work with custom permalinks. This is a longstanding bug, and it’s why I had to use the ?tag= format on my photoblog.
can you use a template tag like this:
&after=&show_images=1&show_description=0&orderby=url); ?>
(I took it from here http://codex.wordpress.org/Template_Tags/wp_list_bookmarks)
And where is the others new APIs in codex? Sorry, but I dont think this is a good work…
Hm, more where, exactly?
Hmm, so wp-cache 2.0.22 works properly for you? For me, comments and posts still don’t show up until I clear cache. :-/
Thanks for the heads-up on the UTW issue. Gives me something else to test a bit better before I pull the trigger on the upgrade!
Niklas – more here in a few days time 🙂
michelem – I can use those tags just fine. They’ve been like that for a few years now so I’m quite sure people are used to them by this stage. Are you offering to document the new APIs? The documentation is a volunteer effort and having another hand to help would be great!
HandySolo – That’s unfortunate. All caching problems disappeared when I upgraded. Are you sure you upgraded all files? Or you could downgrade to 2.0.19 again, although that does have a strange ob_flush problem.
If you do downgrade, grab my patch that improves the caching if you’re getting a lot of spam comments (and who isn’t in this day and age?)
I don’t seem to have the utw problem after the upgrade (unless I understood your explanation – quite likely!).
I am using utw 3.141592
Tom
Tom – I can replicate the problem by entering a test comment that akismet will catch (using names like “test commenter99” and email address of “test@test.com” seems to be a good way to make that happen). Once I release the comment from akismet, tags gone. However…
Donncha – Did you see the comment from 082net at the UTW release thread? Adding two lines of code seems to have fixed things.
I hope to hear a final version soon.I had been using this plugin and its really awesome.I need not to say that but my thanks for this plugin u made.
I will keep track of thee post
Thx and Regards
Ashish
I don’t think that I’m game to upgrade to WP2.1 until this UTW thing is sorted out. How annoying! (The joys of the upgrade path 😉 )
Thanks HandySolo, that was it. Hopefully Christine will package that fix into a new release soon!
Matt – nothing stopping ya now from upgrading!
Same here – WP_Cache 2.0.22 didn’t dump the cache on new comments so they didn’t show up. I’m still running an older version for now.
Still going to try WP 2.1 on a couple of my smaller sites – we’ll see how it goes. Hitting the MySQL query cache more often is a great thing!
No wonder my tags had been mysteriously disspearing. Thanks, Donncha!
Hi Donncha, is that fix for UTW working for you well here.
I want to upgrade to 2.1, but just holding it off until I’m sure UTW works. After SK2, this is my most needed plugin.
Ajay – it works fine, on this blog and on https://inphotos.org/ too, and I’ve approved several comments since applying the fix!
Strange
I have been running UTW (unpatched) with RC2 for a few days without any problems and quite a few comments.
I think I might update UTW with the patch and then upgrade to a final release version of WP
I read that earlier today but didn’t upgrade because from the last post on the UTW site and from the strikeout comment at the top it seemed like there was still an issue.
BigBerries – it’s working fine now. I approved your comment and my tags are still there 🙂
I posted this over on Neato also and wanted to let you know:
The fix by 082.net works; however, if you delete the comment that you approved in the first place, the tags somehow get deleted as well.
Great to hear that Donncha, but will I need to moderate my comments?
I don’t think so… cause my comment just got posted and tags didn’t disappear 🙂
Thanks for finding this out … !!!
It’s worth noting that the tag resetting issue also occurs whenever a post receives a pingback or trackback. I reported this issue to Christine a while back, hopefully she can push out a more comprehensive fix for it soon.
odd, the tag reset bug doesn’t seem to have any effect on my install. what version of UTW are we talking about here?
Damn, I hadn’t spotted the tag deletion problem – thanks for this post!
You can also just use
if (!is_admin()) return $postID;
if (!isset($_POST[‘tagset’])) return $postID;
in UTW’s actions file, as per my blog entry from December 😉. Especially the isset($_POST[‘tagset’]) should catch *all* vectors – if the admin is to delete all tags, tagset will be *set* but empty.
Donncha – do you know if anyone has told Christine?
Collin, see my comment above.
Awesome — great stuff, folks!
Maybe tonight I upgrade. 🙂
I’m not seeing this problem either on two upgraded blogs
Good new fix. Your original fix did just what it was supposed to and the new fix appears to clean up the rest of the incompatibility problems.
Many thanks
Doh. I future-posted an article today. It showed up without tags (fix above applied). Watch for that.
THANK YOU. I noticed tags disappearing a few days ago, but couldn’t even figure out why it was happening.
i have another problem with utw, when i try to activate the pluggin, the page goes blank. so i cannot activate it. i never had problems with utw in my last server, now i am migrating everithing and it doesnt work.
what could it be?
thanks
Months later I finally get annoyed and check into this! aghhh. I thought I was doing something wrong with my tags and it was a getting confused, but now I know. Thanks Donncha ! 😀
I’ve been having the same problem as HandySolo when testing the post-in-the-future option. Does anyone have an idea about what’s going wrong ?