Code will be destroyed when saving

General discussion on Zend Studio
webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Code will be destroyed when saving

Post by webdevrl » Tue Dec 27, 2011 2:42 pm

When I save a file the code will be destroyed and subsequent changes will no longer be saved. E.g.
  • Create a new php file
  • Add a class with a function
  • Save, Close, Open, Change, Save
  • Code destroyed

Code: Select all

<?php
class bugfile {
	
	private function _doBug($param)
	{
		if($param == '')
		{
			return false;
		}
	}
	
}
Simple Class

Code: Select all

<?php
class bugfile {
	
	private function _doBug($param)
	{
		
	}
	
}
Code changed

Code: Select all

<?php
class bugfile {
	
	private function _doBug($param)
	{
		
	}
	
}== '')
		{
			return false;
		}
	}
	
}
Corrupted code

Is there any solution to fix the problem?

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

RAID-5 Storage?

Post by webdevrl » Tue Dec 27, 2011 3:19 pm

Could it be related to the RAID-5 network storage? On the local system, I could not yet reproduce the behavior.

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Empty lines help

Post by webdevrl » Tue Dec 27, 2011 4:02 pm

It helps to add a couple of emty lines at the end of the file. With maybe 20 empty lines, I can change and save the code above correctly. A better solution would be appreciated.

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Narrow down the bug

Post by webdevrl » Tue Dec 27, 2011 5:11 pm

Sorry for my soliloquy but I can narrow down the bug on a simple pattern:

Removing contents causes a corrupted file

Code: Select all

<?php
function testing()
{
	// Remove this line
}

Code: Select all

<?php
function testing()
{

}

Code: Select all

<?php
function testing()
{

} Remove this line
}
Adding contents does not:

Code: Select all

<?php
function testing()
{
	// Adding content does not
}

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Problem persists - No idea

Post by webdevrl » Tue Jan 03, 2012 11:43 am

The problem persists and I have no idea how to fix it. It is really annoying to re-open each file and check for the bug. Here another example:

CSS file created with:

Code: Select all

@CHARSET "ISO-8859-1";
Charset changed to

Code: Select all

@CHARSET "UTF-8";
After saving and re-open the file

Code: Select all

@CHARSET "UTF-8";9-1";
The less characters force any function to fill-up. But wich?

Any help is highly appreciated.

User avatar
ganoro
Posts: 409
Joined: Wed Jan 21, 2009 5:00 pm

Re: Code will be destroyed when saving

Post by ganoro » Wed Jan 04, 2012 12:29 pm

any chance this is related to this issue?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367757

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Re: related to this issue

Post by webdevrl » Wed Jan 04, 2012 1:19 pm

The issue seems to be similar but I can't reproduce it.

Sometimes I get following exception when deleting some piece of code:
java.lang.NullPointerException
I found out that it is not the RAID-5, more the OS X Lion Server with file sharing enabled and connected as network drive on Windows 7.

The error occurs only when the file size is smaller than previously.

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Eclipse and SMB sharing issue

Post by webdevrl » Fri Jan 06, 2012 1:06 pm

Okay. Zend support says that this is a known issue and a bug report was already reported.

I went back deep into the web and found a report in October describing the exact same issue with Eclipse and SMB sharing on RedHat. Here is the link:

http://superuser.com/questions/346052/f ... d-gedit-us

We have invested in a more complex, professional development environment including Zend Studio and now fail on the bottle neck of saving files.

Any idea that can solve the problem is still very welcome.

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Still no success

Post by webdevrl » Mon Jan 16, 2012 11:33 am

Also on bugs.eclipse.org I can find no corresponding entry to SMB sharing and corrupted files.

webdevrl
Posts: 12
Joined: Tue Dec 27, 2011 2:16 pm

Who seeks will find

Post by webdevrl » Tue Jan 17, 2012 12:23 pm

Bug 327050 from 2010 describes exactly the issue. The task is open:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=327050

Does this help anyone?

Post Reply