default userpic

Altered archive mappings

Vote 0 Votes

I'm going to start this thread again and see if I get a bite...

Can someone please explain to me why all of my author basenames are getting appended with an underscore and a number, generally one? For example: johnlennon would become johnlennon_1

So, if my author URL was http://www.site.com/authors/john_lennon/

it has been changed to http://www.site.com/authors/johnlennon1/

Not only is it unattractive to be an "author" on the site and have your name include a number that doesn't show up anywhere else, it breaks old links on the site (requiring a republish of the whole site to fix) and it breaks external links that have existed for years.

It also leaves me with 2 directories for the same author. The correct DIR, the one without an _1, now has stagnant data in it because it is no longer getting updated. We don't know when profile info gets updated, so we end up with internal link in which some of the links point to the _1 directory and others do not.

All external links generally point to the directory without the _1, which is the directory with outdated data, of course.

In other words, this is a REALLY bad thing.

I can go to the database and manually edit the basename to remove the _1. However, if the profile information for that author gets updated, the _1 gets re-added upon saving that profile information.

Is there a fix for this?

I have verified the following:

  1. It happens regardless if there is only one person with that name. Every author gets this _1 added to their basename, which in turn gets propagated to URLs and directory names when using %a in archive mappings or using ArchiveURL in an ArchiveList

  2. Removing the _1 via a direct DB edit will fix the problem until a profile update occurs. Even if nothing changes in the profile, clicking Save WILL change the author basename back to including the _1

  3. I can find nothing to stop this madness.

Reported on Movable Type 4.2

8 Replies

| Add a Reply
  • Aaaah, yes. I helped another customer with this issue. Let me dig up my notes.

    Ok... First, there is a bug that will be fixed with the next release, so what I am offering is a stop-gap solution. Use the following "Custom" archive mapping for authors:

    /%i

    The first regex_replace will convert underscores to hyphens because dirify is not being respected here (bug #1).

    The second regex_replace removes the errant _1 (bug #2).

    Is that what you are after?

    • Byrne,

      It "almost" works...There is one issue it doesn't fix, though I imagine I can find another way to code it...

      But this code

      <$MTEntryLink type="Author"$>
      

      outputs the _1 in the links... a regular MTArchiveLink tag outputs the correct link, however.

    • Actually, it didn't work at all. The _1 still shows up in the directory names too.

      Here's the actual code I used to match my URL structure:

      contributors/<mt:AuthorBasename regex_replace="/_1$/g","">/%f
      

      And it outputs contributors/jerame_davis_1/index.php


    • Byrne,

      I've had some time to work with this some more and here's the issue:

      The fix you gave me works just fine for Author Monthly Archives, but does NOT work for Author Archives. I have tested this multiple times now and can't seem to get it to work on Author Archives, so what I end up with is my Author Monthly Archives are in one folder and my Author Archives are in another folder.

  • yes. i'm having this issue too. it's kind of driving me crazy.

    is there still really no solution to linking to basic author archives??? it's crazy that there's been no mt:AuthorArchiveLink that works the same as category archives for so long.

    now this???!!!

    • Dave, the fix Byrne gave above DOES work. It just creates two sets of directories - 1 with the _1 and one without. The permalinks go to the correct place even if the second, incorrect directory is created.

      It's a crappy fix (slows down template builds since it builds those templates twice) but it works for now until they fix the bug.

      Let me know if you need some help on this.

      • I have found that if you generously enable template module caching, that such a scenario doesn't really add much overhead to the rebuild process. In my case, I rebuild archives with underscores and with dashes (two sets because some old links used underscores) and because I cache every module that doesn't change between files, it adds maybe 2-3 minutes tops to my rebuild process. That's with about 1,600 pages to rebuild :)

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

694 2908

Last Topic: Blogspot to Movable Type by sdude on Feb 8, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 565

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012