U4-3033 - Line gets added to Stylesheet

Created by Laurence Gillian 03 Oct 2013, 10:39:37 Updated by Sebastiaan Janssen 26 Nov 2013, 17:11:54

This one has been in Umbraco for quite some time. Occasionally the Umbraco application will add a blank line into the bottom of a stylesheet.

In the old days before version control and editing files on LIVE servers this wasn't a problem, but discarding these unchanged files from source control, is a manual process that shouldn't have to exist.

I find myself having to explain to new Umbraco developers, that this is 'how it is' and it's little things like this, which let Umbraco down. This problem is made more apparent when using uSync, as the extra line causes uSync to 'see' a change, and modifies the related uSync files.


Sebastiaan Janssen 03 Oct 2013, 12:05:51

Weirdly, I've never had this happen before. So the question is: when does this happen? Do you use the stylesheet editor in the backoffice (I never did so that might explain) and does it does this when you just open a css file maybe? Or when you save the file without making changes (not sure why you'd do that though)?

Laurence Gillian 03 Oct 2013, 16:22:56

I've been seeing this one for years! I've just checked a project out, into a fresh Windows 8 instance, and when the application starts up, the whitespace gets added to all the CSS files. I'm seeing this with and without uSync installed.

I'm working with either Visual Studio or TextMate via a fileshare on the Mac. (I'm seeing this with both Hg/Git)


Referenced in: http://our.umbraco.org/projects/developer-tools/usync/usync/45170-uSync,-Source-Control,-Best-Practices-for-Whitespace

Sebastiaan Janssen 04 Oct 2013, 14:06:21

Would love to help, but I can't repro at all.. I can see that people have this happen but I would appreciate if you could make a tiny example site that exhibits this problem and steps to reproduce.

Laurence Gillian 04 Oct 2013, 14:32:44

Sure thing, I'll make a site and pop it up on GitHub. Have a good weekend :) Lau

Robert Stocks 15 Oct 2013, 08:13:33

The is due to the editor properties logic, When writing the file the code outputs two lines when reading the file it only strips one of the line,

I had a fix for this that I just hadn't got around to submitting a pull request for - I have now submitted it at https://github.com/umbraco/Umbraco-CMS/pull/166

Sebastiaan Janssen 15 Oct 2013, 08:15:09

Thanks Robert! Fixed in rev 4651dfc7632eac6f630382f100be99b7f7c7d46b

Robert Stocks 16 Oct 2013, 10:56:16

My apologies Sebastiaan, I submitted the wrong version of the fix, new pull request with the proper fix https://github.com/umbraco/Umbraco-CMS/pull/169

Robert Stocks 26 Nov 2013, 17:05:04

Hi Sebastiaan, why did you mark this as open again? Is it not fixed?

Sebastiaan Janssen 26 Nov 2013, 17:11:51

Oh sorry, must've hit the wrong button somewhere! :-)

Priority: Normal

Type: Usability Problem

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 4.11.10, 6.1.3, 6.1.4

Due in version: 6.2.0


Story Points: