Copied to clipboard

Flag this post as spam?

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


  • Stefan 117 posts 215 karma points
    Dec 29, 2009 @ 18:23
    Stefan
    0

    Empty stylesheet tree node

    Hi.

    When editing/adding some some of my stylesheets from within Umbraco, the Stylesheet tree node suddenly shows up empty?

    I have checked permissions of the css-folder, and nothing is wrong.

    The files are still in the css-folder. Umbraco has just lost track of them somehow.
    - and I have not been fooling around with any system-related settings, so it seems very strange to me.

    I have searched for an answer, but the only similar post I have been able to find is this:
    http://forum.umbraco.org/yaf_postst9401_Stylesheet-tree-node-is-empty.aspx
    Which is not stating any solutions.

    Help will be greatly appreciated!

    I'm currently on Umbraco v 4.0.2.1.

    Best regards
    Stefan

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 29, 2009 @ 18:30
    Sebastiaan Janssen
    0

    Not a clue. But here's what you can do: add the stylesheets again with the same name. So if one is called "styles.css" on disk, then create a new stylesheet in the tree and call it "styles". I'm almost sure that you'll see the existing stylesheet open up in the editor then.

    Of course, be sure to back-up your files on the disk, just to be sure.

  • Stefan 117 posts 215 karma points
    Dec 29, 2009 @ 18:58
    Stefan
    0

    Thanks for this (obvious) solution, but unfortunately it doesn't work quite the way I wished it would do.

    The stylesheet on disk shows up immediately after saving to the same filename with contents.
    It never shows up in the stylesheet tree - not even after reloading the nodes.

    When creating a new stylesheet I have exactly the same problem. I can add content and save it,
    but it never shows up in the stylesheet tree.

    Could this be a database issue? Maybe the path/filename to the stylesheets has been lost (if such exists?)?
    Is it possible to add the filename entries to the database manually if that's the case?
    But that of course would most likely not solve the issue when creating a new stylesheet.

    Very annoying...

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 29, 2009 @ 19:06
    Sebastiaan Janssen
    0

    Very strange! Check out my comment on this similar sounding issue, there's some logs that you might want to check.

    Yes, you could create them in the database manually, but I would not recommend it. I've already corrupted one Umbraco install by manual modifications in the database. ;)

    See if there's any exceptions, I'm sure it's not a very complicated problem.

  • Stefan 117 posts 215 karma points
    Dec 29, 2009 @ 20:25
    Stefan
    0

    Thanks for pointing out the umbracoLog table in your other post. Found this in the log:

    At /umbraco/tree.aspx?rnd=1bb1660b-10a5-4b53-8306-a946e0e75b5e&id=-1&treeType=stylesheets&contextMenu=true&isDialog=false (Referred by: http://myserver.com/umbraco/TreeInit.aspx?app=settings): System.Web.HttpException: '/umbraco/../css/*varmesmedie_news.css' is not a valid virtual path.
       at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
       at System.Web.HttpServerUtility.MapPath(String path)
       at umbraco.cms.businesslogic.web.StyleSheet.setupStyleSheet(Boolean loadFileData, Boolean updateStyleProperties)
       at umbraco.cms.businesslogic.web.StyleSheet.GetAll()
       at umbraco.loadStylesheets.Render(XmlTree& tree)
       at umbraco.cms.presentation.tree.LoadTree(String treeAlias)
       at umbraco.cms.presentation.tree.Page_Load(Object sender, EventArgs e)
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at umbraco.BasePages.BasePage.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

     

    Looks to me that I might have put the * in front of the filename by accident. Could this cause the tree not to load?

    Also in the cmsStylesheet table I can see that not every node has a filename associated. Is it safe for me to try to add the correct filename
    for the node? And even delete entries?

  • Stefan 117 posts 215 karma points
    Dec 29, 2009 @ 21:31
    Stefan
    1

    Topic solved!

    1. Found the error in the umbracoLog table as shown in the above post.

    2. The * in front of the filename pointed me in the direction that the filename somehow caused the error.

    3. Looked through the cmsStylesheet table and found some strange entries. Many filenames were not added to the nodes.

    4. Backed up all my stylesheets (from the css-folder) and then deleted all the entries in the cmsStylesheet table.
    Some rows could not be deleted and gave this error (in MS SQL Server Management Studio Express):
    Error Souce: .Net SqlClient Data Provider
    Error Message: String or binary data would be truncated.

    Tried many things to delete the rows, but without any luck.

    5. Went back to Umbraco and reloaded the Stylesheet nodes, which showed all my stylesheets (deleted and present).
    Deleted all stylesheets but the one with the * in front (got a permission error). The * had to be removed before I was able to delete it.

    6. Copied all stylesheets back to the css-folder, logged out and back in, reloaded the Stylesheet tree and BANG!

    7. Everything work perfectly again :)

    Hope this helps anyone else having the same (annoying) problem. Thanks go out to Sebastiaan Janssen for pointing me in the right direction!

  • Rich Green 2246 posts 4008 karma points
    Jan 07, 2010 @ 01:04
    Rich Green
    0

    Thanks for your post, I had a similar problem, somehow one of my css files got an extra extension added (stylesheet.css.css).

    I deleted the records from the cmsStylesheet table, renamed the file correctly and all good.

    Strange though as I wasn't accessing the css file directly, only through the back end.

    R

     

     

  • Rich Green 2246 posts 4008 karma points
    Jan 07, 2010 @ 01:28
    Rich Green
    0

    In fact I had to delete each css file in the UI, then manually create each stylesheet again (in the UI), then physically copy the old CSS files over the new ones directly, only then would the CSS show anything.

    Hmm. 

  • Chris A 11 posts 32 karma points
    Dec 14, 2010 @ 23:02
    Chris A
    1

    Hi, just encountered this same problem (CSS node not loading, strange entries with no file names in the cmsStyleSheetTable). In my case caused by a stylesheet (I was adapting a css theme for use with Umbraco) with ".css" pseudo-extension in its sheet name

    Fixes were taken from the discussions above - thank you very much for this !

    Steps were:

    (1) Delete entries from cmsStylesheet table

    (2) Delete physical css files from /css folder

    (3) This causes CSS nodes to magically appear again in back office UI.  Delete each css node in UI

    (4) Recreate the CSS, making sure this time to not include ".css" in node names.

     

  • Tim 66 posts 89 karma points
    Oct 23, 2012 @ 00:46
    Tim
    0

    @Chris A

    Thanks this worked a treat!! 

  • Steve 15 posts 36 karma points
    Jun 19, 2013 @ 01:45
    Steve
    0

    I got the same issue today.  I placed the file name in the admin as .css, so it created a .css.css file.  This caused the node to display nothing when CSS files were there and the DB table had no filenames in the entry.  I deleted the files in error (.css.css) and left the rest.  I then come back to the admin tool and everything was good again.  I will readd them.

     

    Umbraco Support, this has been identified in 2009, could you look to stop users entering the file extension in the backoffice admin please.  A simple fix to save us pain/panic.

Please Sign in or register to post replies

Write your reply to:

Draft