Results 1 to 12 of 12

Thread: The CSS-files are lost

  1. #1
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default The CSS-files are lost

    Hi,
    I've been working on a site for the last two weeks and I was almost finished. Today when I had a look at the website, it looked terrible. It turned out that the CSS-files were gone! :cry:

    How can this have happened? I manage my CSS-files manually and had them placed in the Typolight root, and manually attach the stylesheets in the fe_page template. I do not use the built in CSS-editor at all, which I know can cause problem (Do not manually edit CSS-files if you use the built in CSS-editor).

    I looked in the typolight logs and didn't notice something special. It says that during the night the 'temporary directory was purged', but that happens every night so that should not be the problem.

    I've had no problems the last two weeks of building the site. But during this night something must have happened. I have a backup of the CSS-files on my local harddrive, but they are a few days old... :cry:

    I will check with my hosting provider if they know something. But do any of you know what could have caused this?

  2. #2
    User PaoloB's Avatar
    Join Date
    06-19-09.
    Location
    Italy
    Posts
    238

    Default Re: The CSS-files are lost

    TYPOLight overwrite the css file in the daily cron job

    If you manage the CSS-files manually, you must import the file in TYPOlight
    Paolo B.
    Contao ambassador
    ContaoCms.it - Sito di riferimento per la comunità italiana

  3. #3
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: The CSS-files are lost

    Really? I thought that only the CSS-files, that are being managed through the in-built CSS-editor, are being automatically updated on the daily cron job. And that way it's not a good idea to edit those files manually through FTP, since they are gonna be overwritten by the data stored in the database.

    But here in my case, I have manually created the CSS-files, uploaded them by FTP to the Typolight root, and edited the fe_page template to include them. The in-built CSS-editor is not used at all. I thought it was safe to do this way.

    So you mean that all *.css files in the root is removed during the daily cron job? Even files uploaded manually? Thats strange, because I have had no problem with removed CSS-files during the last two weeks.

  4. #4
    User PaoloB's Avatar
    Join Date
    06-19-09.
    Location
    Italy
    Posts
    238

    Default Re: The CSS-files are lost

    Quote Originally Posted by Ola
    So you mean that all *.css files in the root is removed during the daily cron job?
    Yes, all CSS is overwritten
    You must upload the css file on the file folder and import the file
    Paolo B.
    Contao ambassador
    ContaoCms.it - Sito di riferimento per la comunità italiana

  5. #5
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: The CSS-files are lost

    Quote Originally Posted by PaoloB
    You must upload the css file on the file folder and import the file
    But if I import the file in the CSS-editor, then I can't manually edit the file through FTP since it will get overwritten. Maybe you mean that if I put the CSS-filed in the tl_files folder they should be safe? Maybe it's just the root folder that gets wiped once and a while.

    If this is true, it's a weird behavior. Why erase all css-files in the root? I understand that css-files edited through the editor gets automatically updated. But files uploaded manually should stay in place.

    And this "daily" cron job waited two weeks before my css-files was erased... Also weird...

  6. #6
    User PaoloB's Avatar
    Join Date
    06-19-09.
    Location
    Italy
    Posts
    238

    Default Re: The CSS-files are lost

    my English is not good, sorry

    The css file are located on the tl root

    If you want to use CSS with TL you must import the css on TL
    When you change the css file, you import the new file.

    If you do not want to use CSS in TL, put the css file on the other folder, eg. tl_files and add the css file on the template manually
    Paolo B.
    Contao ambassador
    ContaoCms.it - Sito di riferimento per la comunità italiana

  7. #7
    User
    Join Date
    10-05-09.
    Location
    Dallas, TX, US
    Posts
    70

    Default Re: The CSS-files are lost

    You can add this to localconfig.php

    Code:
    $GLOBALS['TL_CONFIG']['rootFiles'][] = 'filename.css';
    I normally keep all of my CSS, JS, etc, in a subdirectory within /templates to avoid this problem.

  8. #8
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: The CSS-files are lost

    I finally got my files back now. My hosting provider makes daily backups, so I never really had any panic. But I was lucky that the site didn't were released yet. That would not have been good.

    But to clarify things (according to my understanding):
    Files that exists in the root directory and do not belong to TYPOlight will be erased once and a while.

    This could be clarified a little bit more during installation, as it makes no sense why TYPOlight would erase files without no reason.

  9. #9
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: The CSS-files are lost

    Is this behavior not documented? It seems highly undesirable that unrelated files get erased. If Ola's assessment is correct for css files then it looks most like a bug! TL can not delete files that it does not know, that is unacceptable... (especially IF undocumented :cry: )

    Never lost a file in this way though, pfew...

    Ola, I know for sure that typolight doesn't delete any foreign file as I have many other files in the root. But I never keep css files there. (I keep css files close to the images so the relative paths are shorter and better readable)

  10. #10
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: The CSS-files are lost

    Quote Originally Posted by Vera
    Ola, I know for sure that typolight doesn't delete any foreign file as I have many other files in the root. But I never keep css files there.
    Yes it seems that it is only css-files that gets deleted. On my other TYPOlight installs I have other type of files that are unaffected. I think, according to my logs, that it is the weekly cron jobs that removes the files.

  11. #11
    Official Contao Team
    Join Date
    06-10-09.
    Location
    Stuttgart, Germany
    Posts
    68

    Default Re: The CSS-files are lost

    Hi Ola,

    may be an additional hint:

    I often use this http://www.typolight.org/extension-l...050009.en.html module to be able to writing my css settings and changes in firebug and after fixing the settings you can copy-paste from firebug into css file using the CssEditor. Copy-paste works also from your manual settings and also be editable with the build in css editor - may be give it a try.
    ---------------------------------------------------
    kind regards planepix

    Official Contao team member - Official Contao partner
    workshop contao conference site 2011
    workshop contao conference site 2012

  12. #12
    User
    Join Date
    10-05-09.
    Location
    Dallas, TX, US
    Posts
    70

    Default Re: The CSS-files are lost

    Quote Originally Posted by Vera
    Ola, I know for sure that typolight doesn't delete any foreign file as I have many other files in the root. But I never keep css files there. (I keep css files close to the images so the relative paths are shorter and better readable)
    TL was deleting a file of mine (images.xml) until I added the code I mentioned to localconfig. Someone pointed it out on the forum; don't remember who it was.

    I believe the justification for deleting additional files in root is to prevent a malicious script from installing anything there. Of course I may be mistaken.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •