ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

template file strangeness on template rename

May 11, 2012 4:38am

Subscribe [2]
  • #1 / May 11, 2012 4:38am

    UltraBob

    186 posts

    Writing this really quick without time to do a lot of investigation, but the files that get written to the file system when I go into the template preferences and rename a template are strangely named.  I would be surprised if you can’t reproduce it.  I had a template in the news template group named archive with a corresponding file in the filesystem named archive.html.  I renamed the template to yearly and when I checked back in I had a file named yearly and one named yearly.html both with the same filesize.  Then to test a little further I changed the name of yearly to gailbraith (just wanted something to stick out as obviously different) and now that folder contains gailbraith and yearly.html with equal filesizes.  Obviously what I should have at this point is one file named gailbraith.html.  Now I’ll go do a sync and see what happens ... after a sync things still stand as they were.

    I want to have a template named yearly with a filesystem file named yearly.html.  I’m not entirely sure how to get there from here.  Any help?

  • #2 / May 11, 2012 4:56am

    UltraBob

    186 posts

    Actually on closer examination, that sync brought in yearly.html and gailbraith as templates so I’ll just need to delete gailbraith now.  Still the file system activity seems buggy to me, and it also breaks the stats because the stats count went along to gailbraith and yearly now shows 0 hits.

  • #3 / May 11, 2012 5:17am

    UltraBob

    186 posts

    It turns out this still ends up being an issue for me since I’m working with version control.  I did the initial work on my local machine.  When I moved up to the development server I went into the template manager and changed the template name to yearly and then in the filesystem deleted the file named yearly that had been created.  I did a git pull which brought in yearly.html and then I did a template sync.  Unfortunately instead of recognizing yearly.html as the file that should be associated with the yearly template it ignored yearly.html and recreated the yearly file.  Now on the development server I not only have the template file without an extension, but it is also out of version control.  I did a search of the entire database and couldn’t find where the filesystem filename is being stored.  Could really use some help at getting this wrangled back into line.

  • #4 / May 14, 2012 10:39am

    Shane Eckert

    7174 posts

    Hello UltraBob,

    I am sorry to hear you are running into this problem.

    Can you tell me what version of ExpressionEngine you are currently running?

    Does this template have any PHP in it?

    Does this rename behavior act the same on all template, even a newly created one that is empty?

    Please let me know.

    Cheers,

  • #5 / May 14, 2012 10:58pm

    UltraBob

    186 posts

    v2.4.0 - Build: date 20120123

    no php

    created testtemplate:

    ➜  news.group git:(ee2_update) ✗ ls
    categories.html  pageTitle.html  sideBar.html  testtemplate.html  yearly.html
    index.html       region.html     story.html    yearly

    renamed testtemplate to test

    ➜  news.group git:(ee2_update) ✗ lscategories.html  pageTitle.html  sideBar.html  test       yearly
    index.html       region.html     story.html    test.html  yearly.html

    made a change to test so we can see what file gets updated:

    ➜  news.group git:(ee2_update) ✗ ls -l
    total 44
    -rwxrwxrwx 1 bob    bob    3978 May  8 18:09 categories.html
    -rwxr-xr-x 1 bob    bob    4172 May 11 18:16 index.html
    -rwxrwxrwx 1 bob    bob     224 Apr 19 14:34 pageTitle.html
    -rwxrwxrwx 1 bob    bob    3978 May  8 18:09 region.html
    -rwxr-xr-x 1 bob    bob    1291 May 11 18:16 sideBar.html
    -rwxrwxrwx 1 bob    bob    5041 May  8 18:09 story.html
    -rw-rw-rw- 1 apache apache    7 May 15 12:04 test
    -rw-rw-rw- 1 apache apache    0 May 15 12:01 test.html
    -rw-rw-rw- 1 apache apache 3685 May 11 18:17 yearly
    -rwxr-xr-x 1 bob    bob    3761 May 11 18:16 yearly.html

    renamed test to test2:

    ➜  news.group git:(ee2_update) ✗ ls -l
    total 44
    -rwxrwxrwx 1 bob    bob    3978 May  8 18:09 categories.html
    -rwxr-xr-x 1 bob    bob    4172 May 11 18:16 index.html
    -rwxrwxrwx 1 bob    bob     224 Apr 19 14:34 pageTitle.html
    -rwxrwxrwx 1 bob    bob    3978 May  8 18:09 region.html
    -rwxr-xr-x 1 bob    bob    1291 May 11 18:16 sideBar.html
    -rwxrwxrwx 1 bob    bob    5041 May  8 18:09 story.html
    -rw-rw-rw- 1 apache apache    7 May 15 12:05 test2
    -rw-rw-rw- 1 apache apache    0 May 15 12:01 test.html
    -rw-rw-rw- 1 apache apache 3685 May 11 18:17 yearly
    -rwxr-xr-x 1 bob    bob    3761 May 11 18:16 yearly.html

    So it seems to work the same on new templates.  On first rename it creates a version with and a version without an extension, from then on it works on the version without an extension, if the file doesn’t have an extension and it gets renamed it acts as expected as long as you expect it to continue creating files without extensions.

  • #6 / May 16, 2012 4:57pm

    Shane Eckert

    7174 posts

    Hello UltraBob,

    Did you rename the template via the command line or through FTP?

    I notice that when you rename testtemplate to test we end up with test and test.html, so wondering where that came from.

    We may need to get in a take a look.

    Thanks,

  • #7 / May 16, 2012 5:43pm

    UltraBob

    186 posts

    I renamed via the control panel.

  • #8 / May 21, 2012 3:55pm

    Shane Eckert

    7174 posts

    Hello UltraBob,

    That is so odd,

    One more question. Does this happen when you operating on a directory that is not in Git?

    Thank you,
    Shane

  • #9 / May 22, 2012 12:10am

    UltraBob

    186 posts

    Hi Shane,

    I don’t really have time to investigate that at the moment, but there should be no possible way for git to be affecting this.  Git doesn’t keep anything in that folder, or even touch that folder until I run a git command.  Are you not able to replicate this?  Maybe the appropriate question is what addons I’m using if that is the case?

    Bob

  • #10 / May 23, 2012 4:26pm

    Shane Eckert

    7174 posts

    Hey UltraBob,

    I was unable to reproduce this, but I was also not using a git repo to generate the directory.

    I find the opposite to be true. After renaming to a file without an extension, that file gets ignored and the new file with the extension is now the file we are working with.

    Can you go ahead and list off your Add-Ons?

    I am also going to ask another CAT to try and replicate.

    Thanks,

  • #11 / May 23, 2012 5:32pm

    UltraBob

    186 posts

    That last reply gives me a sneaking suspicion that you may not be following what I’m actually doing. I am renaming the template from within the EE control panel. When I am at a computer I will try to remember to give you a step by step of exactly what I am doing. I am not renaming the files from the filesystem. I did try to name them back to something with an extension after EE stripped it out from the terminal but it was NOT the first rename operation. I will try to get a list of addons and a step by step of what I did together when I get to a computer. Can you confirm whether YOUR rename operation was within EE?

  • #12 / May 23, 2012 5:34pm

    UltraBob

    186 posts

    And just on a side note. My EE 2.4 install still tells me it is up to date.

  • #13 / May 23, 2012 10:23pm

    UltraBob

    186 posts

    Here are the steps I take to rename the template:

    1. Open the template in the control panel
    2. Pop open preferences
    3. type in a new name
    4. save

    Here are my addons:

    **Accessories
    Mega Error
    Rename Publish Tabs

    **Extensions
    MD Character Count

    **Plugins
    CE Image
    Character Clipper <- Privately developed
    Feed Enclosures < updated from EE1
    FLV Player Plugin < updated from EE1
    GWcode Categories
    hier build < Privately developed
    Low Yearly Archives
    Markdown < updated from EE1
    Parse URL < customized and updated from EE1
    Rearview < updated from EE1
    Show Count < Privately Developed
    Site Info < Privately Developed
    Sub Cat Query < privately developed
    Video Finder < privately developed
    World Limiter Plus < updated from EE1
    XML Encode

  • #14 / May 23, 2012 11:32pm

    UltraBob

    186 posts

    This seems to describe my issue probably: https://support.ellislab.com/bugs/detail/17449

    It has a status of bug fixed, does that mean that this should be fixed in 2.5?  If so, I’m assuming I’ll still need to try the solution described in the bug report to get things resolved before installing the update.  I’m guessing that installing the update with the error in place would let the error continue on, perhaps without an easy way of fixing it now?

  • #15 / May 24, 2012 1:12am

    UltraBob

    186 posts

    That bug report does seem to have fixed my issue.  I wish my first bug report search had been more successful.  It would have saved me 13 days.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases