How to Fix a Common MT4 Feed Formatting Error

Over the last few years, the term beta has been somewhat misused. It used to be that when you used beta software, you expected to encounter problems. But when Google started throwing around the term for its offerings, people came to expect that beta software wasn’t so bad. Still need an example? Despite Gmail arguably being the leader in web-based email systems, it’s had that tag for more than two years.

There are plenty of examples, but hopefully you get the point I’m trying to make – that beta just doesn’t mean what it used to. So there really shouldn’t be a surprise that people install beta software. It used to be that only a certain crowd would install beta software, but these days, just about everyone will do so, thinking that they can expect to get what they have come to expect. That’s not always the case, as sometimes you can get nasty surprises.

One of those surprises comes in the form of a malformed feed in MT4.

You may notice that there is absolutely no formatting within. Luckily, there is also a very easy fix for the problem. But first, a small explanation of exactly what is happening.

When MT 4.01 was released, the release notes said that a bug (#56367 for those keeping track) had been fixed. We were told that the formatting for Markdown was not processing correctly in feeds. In actuality, this isn’t really accurate.

The problem doesn’t have anything specifically to do with Markdown – it has to do instead with the fact that in an earlier beta of MT4 distributed feeds with the wrong attribute on the MTEntryBody and MTEntryMore tags. It may look like any of these:

<$MTEntryBody encode_xml="1" convert_breaks="0"$>
<$MTEntryMore encode_xml="1" convert_breaks="0"$>
<$MTEntryBody encode_xml="1" convert_linebreaks="1"$>
<$MTEntryMore encode_xml="1" convert_linebreaks="1"$>

What is happening is that the convert attribute – whichever one you are using – will override your text filter (perhaps Markdown, as Tim was using in the screenshot above) and you will end up with garbage. To correct the problem, simply load up your feed templates and change the lines to this:

<$MTEntryBody encode_xml="1"$>
<$MTEntryMore encode_xml="1"$>

You may need to do a bit of digging, because if you are using something like the Continue Reading link, the fields might not be right next to each other. Also, make sure that you check for both Atom and RSS templates, because both will be affected by this “bug”.

If the first version of MT that you installed was after MT4 and prior to 4.01RC2, then you may be affected by this, so check your templates. If you upgraded your blog from a previous MT release, then you should be fine – as long as you don’t create a new blog using the default templates before you upgrade to MT 4.01. Finally, if you haven’t upgraded to MT 4.01, you should do so now!

Tutorial cross posted on Learning Movable Type.


Posted

in