Categories in mt:entries Fix

There is an error in how the tag handles category names in MT 4.25. This error does not occur for categories consisting of a single word or otherwise does not contain spaces.

The following code samples will generate an error in MT 4.25, indicating that your installation is affected by the bug:

 <mt:entries category="NOT (Category Name)"> ... </mt:entries>

 <mt:entries category="Salt & Pepper"> ... </mt:entries>

MT will show a publishing error indicating that you have an error in your 'category' attribute when you're actually using the category logic as you have had in previous versions.


The Fix

    The method for parsing the categories within an <mt:entries> tag has been fixed to allow categories with whitespace in the name and a logical operator, such as AND, OR, or NOT.

Please download the following patched code file and follow the instructions below to put it in place: 

ContextHandlers.pm



Placing the Fix

The targeted file you're going to replace is in lib/MT/Template/ContextHandlers.pm.

First, create a backup of that file by either renaming it to be ContextHandlers.pm.bak or copying its original into your home directory for safe keeping.

Then, upload the ContextHandlers.pm file you've downloaded from above, and move it to the lib/MT/Template directory to replace the original.

Navigate to the template causing an error in your MT installation, and republish the template.  Confirm that the bug has been addressed; otherwise, revert the backup file.

Feel free to file an MT Support ticket if you have any questions about this patched file's placement.

0 TrackBacks

Listed below are links to blogs that reference this entry: Categories in mt:entries Fix.

TrackBack URL for this entry: http://www.movabletype.com/cgi-bin/mt/mt-tb.cgi/253

Leave a comment