Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Aug 10, 2011 @ 13:53
    Dan Diplo
    0

    Not working with one particular stylesheet

    First, thanks for a great package - really cool!

    I have, however, encountered a small bug. On a default Umbraco site with the Simple Website starter-kit installed I have the following CSS files in place:

    Now, your package works as expected with all of the stylesheets except the last one Starterkit. When I try and minify it (or any of the other functions) I get a FileNotFound exception as below:

    File not found

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: Sitereactor.OptimizeIt.Sprite.Exceptions.FileError: File not found

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [FileError: File not found]
       Sitereactor.OptimizeIt.Sprite.IO.LineReader..ctor(String filePath, String source, IEnumerable`1 filters) +168
       Sitereactor.OptimizeIt.Sprite.Css.CssParser.ParseStyleSheet() +114
       Sitereactor.OptimizeIt.Sprite.Css.CssParser.get_StyleSheet() +84
       Sitereactor.OptimizeIt.Sprite.Css.CssParser.VerifyImagesInCss() +77
       Sitereactor.OptimizeIt.Sprite.Web.ParseCss.OnLoad(EventArgs e) +268
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
    

    The file does exist on disk and there doesn't seem to be anything particular about it. The full error can be seen below in sreenshot:

    Doesn't make much sense to me, but perhaps you can work it out?!

  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Aug 10, 2011 @ 13:59
    Morten Christensen
    0

    Hi Dan,

    What is the name of the Starterkit you installed? I would like to try and recreate the issue, which seems to revolve around the Starterkit.css.

    However, the error seems to come down to a check for images in the stylesheet. It shouldn't crash as in your case, but im thinking the error could be due to a missing image in the CSS.

    - Morten

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Aug 10, 2011 @ 15:42
    Dan Diplo
    0

    Hi Morten,

    The start kit was called Simple Starter Kit. Can't seem to see it on the package repo, but it was one of the ones you get as an option when you do a default install of Umbraco 4.7 It is being used with the Sweetas feijoaSkins, which also were one of the skins offered with the default install.


    For reference, the problematic stylesheet CSS (if this helps) is:

    /*LAYOUT*/
    
    body{text-align: left; padding: 0px; margin: 0px; background: #F6F7F9;}
    
    #main{margin: auto; margin-top: 20px; text-align: left; width: 870px;}
    
    #top{border-bottom: 1px solid #CED7DE;}
    
    #top ul{list-style: none; padding: 0px 0px 15px 0px; margin: 0px;}
    #top ul li{display: inline; margin: 0px; padding: 0xp;}
    #top ul li a{padding: 10px 20px 10px 0px; color: #000}
    
    #top ul li.current a{font-weight: bold}
    
    #body{margin: auto; padding: 2em 0em 2em 0em;}
    #footer{padding-top: 5px; clear: both;}
    
    /* Subpages layout */
    #content.textpage{text-align: left; float: left; width: 75%;}
    #subNavigation{margin-top: 40px; width: 22%; float: right;} 
    #subNavigation ul{list-style: none; border: 1px solid #FFE8CD; background: #FFF9D8; display: block; padding: 10px; padding-left: 0px;}
    #subNavigation ul li{margin: 0; padding: 0px; padding-right: 10px;}
    
    /* FONTS standards */
    body {font-size: 14px; background:#fff; font-family: "Lucida Grande", Arial, sans-serif;}
    
    h1, h2, h3, h4, h5, h6 {color: #426FC8; font-weight: 500;}
    h1 {font-size:60px; line-height: 1; margin-bottom:0.5em; font-weight: bold; letter-spacing: -1px; width: auto; color: #666;}
    h2 {font-size:25px; margin-bottom:0.75em;}
    
    h3 {font-size: 18px;line-height:1;margin-bottom:1em;}
    h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
    h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
    h6 {font-size:1em;font-weight:bold;}
    h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
    
    p {margin:0 0 1.5em; font-size: 16px;}
    p img {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
    p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
    
    /* LINKS standards */
    a:hover {color:#000;}
    a {color: #426FC8; text-decoration:underline;}
    h1 a{color: #666; text-decoration: none;}
    
    /* ELEMENTS standards */
    blockquote {margin:1.5em;color:#666;font-style:italic;}
    strong {font-weight:bold;}
    em, dfn {font-style:italic;}
    dfn {font-weight:bold;}
    sup, sub {line-height:0;}
    abbr, acronym {border-bottom:1px dotted #666;}
    address {margin:0 0 1.5em;font-style:italic;}
    del {color:#666;}
    pre, code {margin:1.5em 0;white-space:pre;}
    pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
    li ul, li ol {margin:0 1.5em;}
    ul, ol {margin:0 1.5em 1.5em 1.5em;}
    ul {list-style-type:disc;}
    ol {list-style-type:decimal;}
    dl {margin:0 0 1.5em 0;}
    dl dt {font-weight:bold;}
    dd {margin-left:1.5em;}
    table {margin-bottom:1.4em;width:100%;}
    th {font-weight:bold;background:#C3D9FF;}
    th, td {padding:4px 10px 4px 5px;}
    tr.even td {background:#E5ECF9;}
    tfoot {font-style:italic;}
    caption {background:#eee;}
    
    /* FORM ELEMENTS */
    label {font-weight:bold;}
    fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
    legend {font-weight:bold;font-size:1.2em;}
    input.text, input.title, textarea, select {margin:0.5em 0;border:1px solid #bbb;}
    input.text:focus, input.title:focus, textarea:focus, select:focus {border:1px solid #666;}
    input.text, input.title {width:300px;padding:5px;}
    input.title {font-size:1.5em;}
    textarea {width:300px;height:250px;padding:5px;}
    .error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
    .error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
    .notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
    .success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
    .error a {color:#8a1f11;}
    .notice a {color:#514721;}
    .success a {color:#264409;}
    
    .error ul{margin-bottom: 0; padding-bottom: 0;}
    
    
    /*BLOG STYLES */
    #content .post{text-align: left;}
    
    /* Clear fix to repleace br clear:both */ 
    .clearfix:after {
      content: ".";
      display: block;
      clear: both;
      visibility: hidden;
      line-height: 0;
      height: 0;
    }
    
    .clearfix {
      display: inline-block;
    }
    
    html[xmlns] .clearfix {
      display: block;
    }
    
    * html .clearfix {
      height: 1%;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    /* EDITOR PROPERTIES - PLEASE DON'T DELETE THIS LINE TO AVOID DUPLICATE PROPERTIES */
    
    Many thanks for all your work - the package is great (apart from this small problem)!
  • Morten Christensen 596 posts 2773 karma points admin hq c-trib
    Aug 11, 2011 @ 09:14
    Morten Christensen
    0

    Hi Dan,

    Can I get you to create a new stylesheet and paste the styles from Starterkit.css into it? Just to make sure whether its a problem with the file itself or the styles within it.

    Thanks

    - Morten

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Aug 11, 2011 @ 10:45
    Dan Diplo
    0

    Hi Morten,

    I did as you asked and made a new style-sheet (within Umbraco) and pasted in the styles, and the error occured in the copy too. I should also point out that when trying to minify this stylesheet a file is created that is called .min.css that is empty.

    What is weird is that I deleted all the styles in the copy of the style-sheet I'd just created and validated it and yet the error still occured! I also tried renaming the stylesheet (within Umbraco) to a few different names and error still occured.

    I then did another test - I created a new style-sheet within Visual Studio and then pasted the styles from Starterkit.css into it and then validated it and that worked! I also tried resaving this style-sheet via Umbraco and re-validated and that also worked. I should point out that it validated fine without errors (and when I added a deliberate error this was picked-up).

    For my final test I created another blank stylesheet directly from Umbraco and attempted to validate it - but this also generated an error. It seems like any new style-sheet I create from within Umbraco causes the error, regardless of content.

    As a developer myself I find that as puzzling as you must do. All I can think is that it's perhaps to do with line endings or file encoding? Perhaps some are using /n and some /r/w or something like that? Are perhaps VS uses UTF-8 and Umbraco doesn't?

    Oh, and I just checked the UmbracoLog table to see if there were any relevant errors in there and found these messages:

    At /umbraco/plugins/sitereactor/optimizeit/parsecss.aspx?id=1125&rndo=87.8 (Referred by: http://localhost:1737/umbraco/umbraco.aspx): Sitereactor.OptimizeIt.Sprite.Exceptions.FileError: File not found     at Sitereactor.OptimizeIt.Sprite.IO.LineReader..ctor(String filePath, String source, IEnumerable`1 filters)     at Sitereactor.OptimizeIt.Sprite.Css.CssParser.ParseStyleSheet()     at Sitereactor.OptimizeIt.Sprite.Css.CssParser.get_StyleSheet()     at Sitereactor.OptimizeIt.Sprite.Css.CssParser.VerifyImagesInCss()     at Sitereactor.OptimizeIt.Sprite.Web.ParseCss.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    At /umbraco/settings/stylesheet/editStylesheet.aspx?id=1125 (Referred by: http://localhost:1737/umbraco/settings/stylesheet/editStylesheet.aspx?id=1125): Sitereactor.OptimizeIt.Sprite.Exceptions.FileError: File not found     at Sitereactor.OptimizeIt.Sprite.IO.LineReader..ctor(String filePath, String source, IEnumerable`1 filters)     at Sitereactor.OptimizeIt.Sprite.Css.CssParser.ParseStyleSheet()     at Sitereactor.OptimizeIt.Sprite.Css.CssParser.get_StyleSheet()     at Sitereactor.OptimizeIt.Sprite.Menu.CssMenuButtons.MinifyCssBtnClick(Object sender, ImageClickEventArgs e)     at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)     at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)     at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    I wouldn't worry about it - it might just be something localised to my installation. When I get the chance I'll try it on another installation to see if the problem can be replicated. Again, thanks for all your hard work.

  • Marcus Maunula 229 posts 386 karma points
    May 10, 2012 @ 00:25
    Marcus Maunula
    0

    Was there any solution to this? For some strange reason this works well in one project but not another.

    Maybe the new Microsoft optimizer could be an option?

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    May 10, 2012 @ 09:29
    Dan Diplo
    0

    Marcus, I never found a solution to the issue. But you can use the ClientDependency Framework (that ships with Umbraco) to perform minification. I've even written a blog post on the subject explaining how. Just note that occasionally it can "break" some stylesheets.

  • Marcus Maunula 229 posts 386 karma points
    May 10, 2012 @ 11:08
    Marcus Maunula
    0

    I tried that but I think I prefer this sicne you can manually pack things. I will read your post thanks.

  • Marcus Maunula 229 posts 386 karma points
    May 10, 2012 @ 11:34
    Marcus Maunula
    0

    The question I still have is how you exclude certain files? I use Google fonts sometimes or other cdn libraries. They seem to break or not work correctly
    when using this. Do you have something on that aspect?

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    May 10, 2012 @ 13:42
    Dan Diplo
    0

    Hi. Sorry, I've only used this with simple examples. I guess to exclude elements you would put them in a separate CSS/JS file and not load them through client dependency? There are some docs at http://clientdependency.codeplex.com/documentation  

  • Marcus Maunula 229 posts 386 karma points
    May 10, 2012 @ 15:00
    Marcus Maunula
    0

    Thinking of just using the Visual Studio extension by the author of BlogEngine, sure it is manual but I like having some control over this :).

    What I don't get is this. This module works perfectly on one website (same server and all) but not this, I can't understand what I did differently.

Please Sign in or register to post replies

Write your reply to:

Draft