I recently upgraded an MT Enterprise install to 4.25 without any problems, until I wanted to rebuild the site which is spread across multiple blogs. One particular blog filters out a specific category from RSS feeds and monthly archives using mt:entries category="NOT Category Label Here", which worked just fine before the upgrade. Now this attribute causes an error upon rebuild, stating there is an error in my category attribute.
I have removed this attribute for now and have started using an mt:Unless within the mt:Entries to filter out the entries, however this is not ideal as it makes the limit and lastn attributes redundant.
Has anyone else come across this problem? Does anyone have a solution?
Reported on Movable Type 4.2
I would hardly believe that this is broken.
As you're having an Enterprise license, I would recommend to open a support ticket for this.
I have this exact same problem. If there is a fix, I'd like to know what's up. I'm NOT using Enterprise, I'm using MT Pro. May same category="NOT Something" logic has worked for over a year and now it is broken after upgrading to 4.25.
FYI, I fixed this problem by replacing this file with an older version
lib/MT/Template/ContextHandlers.pm
By replacing that file with the 4.23 version, my old NOT logic works just fine.
Clearly a bug in the code...
Have you raised it as a bug?
http://bugs.movabletype.org/default.asp?command=new&pg=pgEditBug&ixCategory=1
Yes, I confirm this bug. Until Six Apart will issue a fix, I've been able to fix this problem for myself by replacing the lines:
from line 7997 (" children => ")
up to line 8030 (" if ($cexpr) {")
With the following lines taken from movable type v4.24:
##################### CUT FROM HERE ###########
children =>
$class_type eq 'entry' ?
($args->{include_subcategories} ? 1 : 0) :
($args->{include_subfolders} ? 1 : 0)
});
} else {
if (($category_arg !~ m/\b(AND|OR|NOT)\b|[(|&]/i) &&
(($class_type eq 'entry' && !$args->{include_subcategories}) ||
($class_type ne 'entry' && !$args->{include_subfolders})))
{
if ($blog_terms{blog_id}) {
$cats = [ $cat_class->load(\%blog_terms, \%blog_args) ];
} else {
my @cats = cat_path_to_category($category_arg, [ \%blog_terms, \%blog_args ], $class_type);
if (@cats) {
$cats = \@cats;
$cexpr = $ctx->compile_category_filter(undef, $cats, { 'and' => 0 });
}
}
} else {
my @cats = $cat_class->load(\%blog_terms, \%blog_args);
if (@cats) {
$cats = \@cats;
$cexpr = $ctx->compile_category_filter($category_arg, $cats,
{ children => $class_type eq 'entry' ?
($args->{include_subcategories} ? 1 : 0) :
($args->{include_subfolders} ? 1 : 0)
});
}
}
$cexpr ||= $ctx->compile_category_filter($category_arg, $cats,
{ children => $class_type eq 'entry' ?
($args->{include_subcategories} ? 1 : 0) :
($args->{include_subfolders} ? 1 : 0)
});
}
if ($cexpr) {
##################### CUT UP TO HERE ###########
I've missed to mention that the file you should edit is:
/mt/lib/MT/Template/ContextHandlers.pm
And that you will need to download this file from the server and upload it back after editing in ASCII mode.
Thanks for all the replies guys, and thanks for the fix. When I get a few minutes I'll check the bug site to see if this has not already been raised, and if it hasn't I'll raise it.