stavrosthewonderchicken
Sep 24 2007, 09:46 PM
For the life of me, I can't figure out why rebuilding (whether Entry Archives only or All Files) no longer will rebuild any Entries older than the most recent.
I've tried (unsuccessfully):
- editing/refreshing the Indiv. Entry Archive template
- Adding a new test post (then deleting it)
- Disabling plugins
- Sacrificing a goat
- Deleting and then re-adding the Archive Mapping for the template, which now yields the errors:
Can't call method "is_preferred" on an undefined value at lib/MT/TemplateMap.pm line 119.
and
Can't call method "prefer" on an undefined value at lib/MT/App/CMS.pm line 8041.
when I try to save the template.
If I toggle-select entries on the Manage Entries page and hit 'Republish', republishing seems to work from there.
Help.
---------------
It gets worse. Now I can't map indiv archive templates at all without encountering that first error on save. No matter what I try -- creating new templates, altering old ones, nothing lets me actually save an archive mapping.
Su-
Sep 25 2007, 02:33 AM
QUOTE (stavrosthewonderchicken @ Sep 25 2007, 12:46 AM)

Can't call method "is_preferred" on an undefined value at lib/MT/TemplateMap.pm line 119.
and
Can't call method "prefer" on an undefined value at lib/MT/App/CMS.pm line 8041.
[...]
It gets worse. Now I can't map indiv archive templates at all without encountering that first error on save. No matter what I try -- creating new templates, altering old ones, nothing lets me actually save an archive mapping.
Ugh. I'm pretty sure I know what this is. I've got a bug filed about it, but at this point it's probably not going to be fixed until the 4.1 release. Basically, it seems that at some point you deleted the preferred archive mapping for your individual entries and either didn't pick or create a new one at the same time. MT either shouldn't let you do that, or should at least fall back to the other one as preferred, but it doesn't.
There are only two ways around it at the moment. You can either make a small change directly to the database to re-set the remaining mapping as the preferred one,
or make a completely new archive template, copy over the templating and mappings, and then trashing the original. I can probably walk you through the db hack without too much trouble, but the second option would probably be fastest all around.
(
EDIT: Confirmed recreating the template doesn't work.)
stavrosthewonderchicken
Sep 25 2007, 06:27 PM
Thanks, Su. I figured it was a bug.
I actually tried the second option you mention, I think, to no avail, so I'd be happier just going in to the database and manually fixing whatever needs fixing, if you could point me to the right place (and suggest a good remote tool for MySQL fiddling..)
Su-
Sep 25 2007, 08:45 PM
QUOTE (stavrosthewonderchicken @ Sep 25 2007, 09:27 PM)

I actually tried the second option you mention, I think, to no avail,
Bah! I hadn't actually tried that one out myself yet. It just popped into my head recently as a simpler workaround.
As to the database, your host almost certainly has PHPMyAdmin installed. We're won't be doing anything so involved you'll need a specialized tool. Otherwise, I like SQLYog(I'm on Windows).
Insert standard disclaimer here about backing up your database and not being responsible for your monitor exploding. The instructions below shouldn't break anything in and of themselves, but I can't stop your cat from walking across the keyboard and deleting everything while you're in the database.- First, we need to get the ID# of your template. Go to its edit screen. The URL will look like: [path/to/mt]/mt.cgi?__mode=view&_type=template&id=46&blog_id=2 We want that id value(46 here).
- Now browse the mt_templatemap table of your database, and find one or more rows with a templatemap_template_id value of the number you got in Step 1.
- For any of those, set templatemap_is_preferred to "1" (no quotes) and save changes.
And that should do it. This process I
have done a few times while tracking this down. But lemme know if it doesn't work.
It doesn't matter which you set in Step 3. You can change it later from within MT. All we're doing is fixing that is_preferred error.
If the template from Step 1 has no mappings at all, just create a new row and copy over the information from an existing one of the appropriate type(and set _is_preferred to 1). Make sure you make its templatemap_id value one higher than the last.
stavrosthewonderchicken
Sep 25 2007, 09:45 PM
Thanks, Su, that's fixed the issue with the error messages. You were right, none of the entries in the table for Entry archives had a preferred flag.
Unfortunately, this has now taken me back to the original issue! Rebuilding my Individual Entries only rebuilds (as near as I can tell) the most recent entry.
Any thoughts on that one?
Su-
Sep 27 2007, 06:47 AM
QUOTE (stavrosthewonderchicken @ Sep 26 2007, 12:45 AM)

Unfortunately, this has now taken me back to the original issue! Rebuilding my Individual Entries only rebuilds (as near as I can tell) the most recent entry.
From this end, that one loses me, unfortunately. I'm curious, though: How are you determining that only that last one is rebuilding? And what happens if you unpublish
that one? Does the rebuilding behavior move to the next one down the line?
stavrosthewonderchicken
Sep 29 2007, 01:05 AM
Hmm. I've done some fiddling, and I can't figure out for the life of me what's going on. Changes to the template for Entry Archives are simply not being rebuilt. I've looked at the folders with an FTP client, so it's not a path issue. The old files are there, thank goodness, but they're not being overwritten with the newer-templates versions.
When I rebuild/publish entries (877 total), the progress bar (striped, while it says Publishing Archive Templates...) starts at 100%, then when it moves on to Publishing Entry archives... it starts at like 95% and finishes in a minute or two, having only rebuilt, as far as I can see, the latest entry only. If I unpublish, say, the most recent 5 entries, it seems to only rebuild #6 (which is in that case the most recent).
It also refuses to respect my underscores in file names, reverting no matter what I do to dashes between words. This despite the fact that checking the mt_templatemap table in the actual database says the templatemap_file_template format should be %y/%m/%f, which is underscores. (Edit update: somehow the 'preferred' flag in the templatemap table in the db got set back to zero. Resetting it to '1' again fixed the dashes instead of underscores problem, but nothing else.)
I'm pretty much at a loss, here.
Edit: Weirdly, if I go to the Manage Entries page and toggle-select everything (maximum 100 entries at a time) and hit the republish button, the correct template is found and used to rebuild the entries.
Definitely a bug of some kind, then, I reckon....
Also, for what it's worth, I tried using a completely fresh install of MT (with new fresh DB) and importing the text-file export I made a couple of days ago. The import hung about halfway through (on a trackback (http://emptybottle.org/glass/2004/01/never_mind_the_bollocks_heres_the_wonderchicken.php#ping-272) that was in no way that I could see unusual), repeatedly, so I gave up on that as well.
Sigh. I'm really not having much luck with MT4 at all, sadly, after 6 years without a hitch.
noahvail
May 16 2008, 11:27 AM
I'm having a similar problem and am hoping to revive this thread.
In my case, only individual archives linked from the homepage are publishing with my revised Individual Entry Archives template. For example, I have my blog set to display 10 entries on the homepage. My new template correctly publishes on those individual entries, but not on any of the older entries.
Any thoughts?
UPDATE:
At some point I changed the file extension of my archives from HTML to PHP. So now there are two versions of each individual archive, with permalinks pointing to the HTML version (wrong), instead of PHP (right). So now I have a new, different problem, but it seems more manageable, and maybe someone else will learn from my stupidity.