Help - Search - Members - Calendar
Full Version: Not an ARRAY... Context.pm error
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
korou
Hi. I upgraded my 2.661 installation of MT to 3.0D, and after I wrote my first post and hit the save button, I got this error before it could finish saving:

CODE
Not an ARRAY reference at lib/MT/Template/Context.pm line 614.

The lines surrounding 614 in context.pm:

CODE
612    my $no_resort = 0;
613    if (my $entries = $ctx->stash('entries')) {
614        @entries = @$entries;
615        if (%$args) {
616            my $n = $args->{lastn};
617            ## If lastn is defined, we need to make sure that the list of
618            ## entries is in descending order.

I do use lastn, set to six, in my blog's template for the main page:

CODE
<MTEntries lastn='6'>


When I delete the lastn='6' attribute, the error still occurs.

Entries are not saved and my blog cannot be updated--unless I rebuild the entire site after every post, even then, it's only on the front page and for individual archives.

That would be annoying.

Thanks for any help!
TweezerMan
The code you cited above is from MT 2.661's Context.pm. This is what is in MT3D's Context.pm around line 614:
CODE
       if ($cat_name =~ /\s+(?:AND|OR)\s+/) {
           return $ctx->error(MT->translate(
               "You can't use both AND and OR in the same expression ([_1]).",
               $cat_name ))
               if $cat_name =~ /\bAND\b/ && $cat_name =~ /\bOR\b/;
           my @cats = split /\s+(?:AND|OR)\s+/, $cat_name;
           my %entries;

You probably should re-upload MT3D again, making sure all of the files in all of the subdirectories get uploaded, and making sure that any old MT 2.661 files are overwritten.
korou
Thanks, that worked perfectly.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.