A gotcha in Wordpress 2.5.1
Posted by Jacques Chester on Tuesday, April 29, 2008
The updated copy of TinyMCE embedded in Wordpress 2.5 has bog ordinary indent and outdent buttons, of this approximate appearance:
.
This button essentially just adds a few extra tags in the HTML that say “push this over to the right by 20 pixels”. That would be fine, except that it buggers up a bunch of other formatting rules set by the stylesheet.
The right thing to do is to use “semantic” markup. For quotes, one should use the blockquote tag. For lists, use the list tags. And so on: these are correctly laid out by the stylesheet which has been carefully tweaked by CSS gurus before I, or Wordpress, gets to mangle them.
If, like I do, you want to turn those buttons off in Wordpress, it’s a bit fiddly. The settings for the rich text editor are buried in wp-includes/js/tinymce/tiny_mce_config.php. Scroll down to the 128th line, which will look something like so:
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline',
'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword'...
This line tells the rich text editor what buttons to display. Delete or comment out this bit:
'|', 'outdent', 'indent',
And voila, the offending buttons go away.
General Whinge
This is essentially par for the course for Wordpress.org, of course. A shiny update which breaks things in stupid ways. They talk a lot about their you-beaut new interface (which I don’t think is much of an improvement on the old one), their fancy new uploading scheme (which is less convenient than the boring old one) and their exciting new … well as far as I can tell it was all about shiny things. Not so much about fixing boring bugs for the most part.
It annoys me because I have to bug Ken and Nick to let me upgrade to get access to security patches, which Wordpress.org don’t backport to older versions. Every time I hope it will be a smooth update. Every time I am made to look like a fool.
This entry was posted on Tuesday, April 29th, 2008 at 1:34 PM and filed under Geeky Musings, Site News.
Follow comments here with the RSS 2.0 feed.
Post a comment or leave a trackback.

I’m sypathising, I really am. I have done that more times than I care to remember and lucky my only reader is the googlebot.
I made sure to say that going in so I don’t come across as a complete arsehole. But really, you’ve not got a second copy of CT running somewhere to do migration tests on?
Posted on 29-Apr-08 at 1:56 pm | PermalinkNo, I don’t. I tried to set up virtualisation on the troppo server and it was a total, unmitigated disaster.
Plus, for bonus fun, a migration test wouldn’t have revealed this behaviour in advance.
Posted on 29-Apr-08 at 2:00 pm | PermalinkMy favourite Wordpress bug is that the ‘post_published’ hook fires when a post is published … AND when it is subsequently edited. Yet there is also a ‘post_edited’ hook. That’s been in the bugtracker since 2.2.
That’s why, for a few weeks, everyone was getting a dozen copies of Missing Link. So now instead the code is wired into the ‘private_to_public’ hook. The new interface makes it harder to do this. It used to be that pressing ‘publish’ turned off private status; now you have to click a tickbox as well.
Ken is, quite naturally, ropable.
Posted on 29-Apr-08 at 2:02 pm | PermalinkCan you install TinyMCE as a standalone? I’ve done it in Drupal, and the button you’ve described outputs <blockquote> tags perfectly.
Posted on 29-Apr-08 at 2:04 pm | Permalink(I prefer FCKeditor though, if you need an editor)
Liam;
I’m not keen to do a standalone installation as TinyMCE is fairly closely wired into the standard Wordpress install. Wordpress is hassle enough already.
Posted on 29-Apr-08 at 2:06 pm | PermalinkWell…for a blog a migration test would probably take a while and involve dual posting of posts to live and test and probably some commenting as well. Trying to mimic standard usage at any rate so you can at least see how it is going to work even if you obviously aren’t going to shake out everything.
But it’s a giant pain in the arse to do. I gave up on doing it because I find it easier to just deploy and fix things if they crop up; like Microsoft does :- )
Posted on 29-Apr-08 at 2:06 pm | Permalinkgilmae;
I imagine the test would have to involve ‘replaying’ a bunch of traffic. There are tools around for capturing traffic so it can be replayed. Then you’d need to write tests to compare the befores and afters, and so on.
Ooooooon the other hand, perhaps the Wordpress.org crew could try unit testing their own code. Which they don’t, at the moment. Or fixing old bugs. Which they don’t, at the moment. Or backporting security fixes so I don’t need to stress about this kind of rubbish. Which they don’t, at the moment.
Posted on 29-Apr-08 at 2:08 pm | PermalinkI suppose you could replay, but I got the impression from this post, and Ken complaining in the ML post, that what you don’t like about 2.5.1 were found pretty quickly just with general usage. There are also hacks for running two installations – a released version and a HEAD version, presumably – off the same database.
I tried looking around for their source repository to see if it was even plausible for others to generate patches themselves, but couldn’t find one. Is it not publicly available?
Posted on 29-Apr-08 at 2:23 pm | PermalinkNevermind, found it
Posted on 29-Apr-08 at 2:26 pm | Permalinkgilmae;
Wordpress relies on another dogpile piece of software, MySQL, using MySQL’s preposterously poor MyISAM engine. Which doesn’t have transactions. Or referential integrity. Or indeed anything that separates databases from flatfiles.
So I’m nervous about running two copies off a single database. I might see if there’s a cloning tool though, that could be a way forward.
Posted on 29-Apr-08 at 5:49 pm | PermalinkAs for the Wordpress repo, you can submit patches if you like. They may or may not accept them, depending on whether you’re bestest mates with Matt Mullenweg.
Posted on 29-Apr-08 at 5:50 pm | PermalinkThe idea wouldn’t be to submit patches, and *I* certainly wouldn’t do it anyway not least because I’m not even a little bit interested in improving Wordpress. My point was that if it was enough of a problem then it should be feasible for interested parties to create backport patches for older versions of Wordpress from the change logs. It’d be a thankless job though.
Cloning tool? IANA MySQL Admin, but this works for me rather well.
mysqldump databasename -u username -h hostname -ppassword –add-drop-table –compatible=mysql323 > database.backup
Posted on 29-Apr-08 at 5:57 pm | Permalinkmysql backupdatabasename -u username -h backuphostname -ppassword < database.backup
Jacques,
I haven’t ever used Wordpress for any serious purpose, so I can’t really comment on your buggy experience, but it seems a bit unfair to group MySQL with WordPress.
According to various posts, the InnoDB engine works just fine and has all the features you say you’re missing.
But it does sound like Wordpress doesn’t quite understand what ‘dot point’ releases are all about.
By tradition, 2.5 -> 2.5.1 should be just bug fixes, not major new features like a “new interface”.
Posted on 29-Apr-08 at 10:10 pm | PermalinkStephen;
InnoDB isn’t written by the MySQL people. It’s written by a third party who were subsequently bought by Oracle.
InnoDB doesn’t support TEXT fields, so cannot be used to back Wordpress installations. Which brings me back to bitching about MyISAM :)
Posted on 29-Apr-08 at 10:27 pm | PermalinkIn defence of WP though, the new interface arrived in 2.5, not 2.5.1.
Posted on 29-Apr-08 at 10:27 pm | PermalinkAnd Sun just bought MySQL, didn’t they. I wonder what is going to happen with InnoDB now, if Oracle will quietly shoot it in the head to spite Sun.
Posted on 30-Apr-08 at 7:19 am | PermalinkOracle have given assurances that they won’t pull out the InnoDB rug from under MySQL, but assurances from big IT companies about what they’ll support in future are worthless.
The MySQL people have hired a few old DEC and IBM hands who are writing a new engine called Falcon. It’ll be interesting to see how that goes, but it doesn’t do much for me right now.
Posted on 30-Apr-08 at 4:26 pm | Permalink