Help - Search - Members - Calendar
Full Version: Can't Rebuild Individual Entries
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
mciocco
I'm having some trouble rebuilding my site. I have it narrowed down to the individual entry archives. When I try to rebuild them, it shows up, works for a while, then throws this error:

An error occurred
Can't call method "created_on" on an undefined value at lib/MT/Template/ContextHandlers.pm line 3764.

When I look at the files on my server, it doesn't appear to have processed any of the individual archive files. I'm able to create new entries fine (and I'm able to delete comments fine as well), so MT is obviously able to build an individual entry.

I'm currently running MT 4.01. Oddly, this started happening when I upgraded from MT 4 RC1, which worked well for me. Upgrading broke this and it also broke my ability to preview an entry (that's a separate issue though:P)

Any ideas?

Update: I've narrowed it down a bit. It appears that the listing of comments is what's causing the issue. Removing my lines that list out the comments, and I'm able to rebuild fine (except, you know, I'm not displaying any comments). Now I'm trying to add the functionality back in, bit by bit, but I'm having some trouble. Here's what I tried to add back in:

CODE
<MTComments>
<$MTCommentBody$>
</MTComments>


That's about as basic as it gets, but now I keep getting a 500 Internal Server Error (and none of the entries rebuild).

Update 2: Ok, now I'm really confused. I've been messing around with the new way to do MT tags, so I now have this as my code:

CODE
<mt:Comments>
<mt:CommentBody />
<div class="commenter">Posted by: <$mt:CommentAuthorLink$> on <mt:CommentDate /></div>
</mt:Comments>


Now, when I tried to rebuild, I got a 500 error, but it built about 20 files (the most recent entries). Subsequent attempts to rebuild are met with more 500 errors or the original error I quoted above ('Can't call method "created_on" on an undefined value at lib/MT/Template/ContextHandlers.pm line 3764. ') Occassionally, a new file sneaks through. I've got about 30 entries properly displaying comments now.

So yeah, I'm confused. Is there a better way to rebuild that I'm missing? Perhaps one that gives feedback and says what's choking? Is it me, or does MT 4 seem to have a lot of these types of problems? The RC1 version I was using before worked awesome! I have no idea what the heck happenend when I upgraded to 4.01, but it's been nothing but trouble...

Update 3: When I rebuild, and I get the 500 error, this is the URL:

(my site URL) /mt/mt.cgi?__mode=rebuild&blog_id=2&type=Individual&next=0&offset=20&limit=&total=692&entry_id=&is_new=&old_status=&old_previous=&old_next=

If I go directly to that URL, I get the 500 error... Don't know if this helps or not....
mciocco
Alright, so I got two suggestions:

1. If you have access to a database tool such as phpMyAdmin, you can use it to perform a CHECK of the tables in the Movable Type database, and if necessary, perform a REPAIR of any tables which did not report a status of "OK"

However, this was not an issue for me - I got all OK when I did a check.

2. The particular line in ContextHandlers.pm has to do with sorting comments by a "created_on" value. So maybe I had a comment (perhaps more than one) that had a missing or invalid created_on field. Again, phpMyAdmin might be helpful in looking at the raw database

This didn't solve my problem either, however, when I first went into phpMyAdmin and looked at the comments table, I noticed that I had 20,000 comments that I had marked as spam (MT automatically deletes them after a period of time, but I still had a lot). Rather than page through 20,000 comments, I went into MT and deleted all my spam comments. This left me with a more manageable 2000 comments to look through. Again, I didn't find anything out of place, but when I tried to rebuild, everything worked fine. Go figure.

Not sure why the spam comments would screw it up, but that did seem to fix it...
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.