Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359473 - Eclipse got busted after editing HTML in php file
Summary: Eclipse got busted after editing HTML in php file
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 critical with 10 votes (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 15:55 EDT by gossi CLA
Modified: 2020-05-14 11:27 EDT (History)
11 users (show)

See Also:


Attachments
This is what happens to my eclipse. Screenshot is not modified! (108.19 KB, image/png)
2011-09-29 15:56 EDT, gossi CLA
no flags Details
Details of exception preventing file re-opening after restarting eclipse. (4.76 KB, text/plain)
2011-11-25 08:55 EST, stuart.brockman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description gossi CLA 2011-09-29 15:55:04 EDT
Build Identifier: PDT: 

This happens when you edit a php file within PDT and the PHP Editor.

Actually it happens only when editing the HTML. So if you "close" php by typing "?>" and switching to "HTML-Editing" with auto-close brackets this problem occurs.

So, from time to time typing HTML tags I do type but the characters don't show up. If I hit cmd+s, close the file and open it again, the characters appear in a different order then I typed them.

If I dont' hit cmd+s and reopen, I will run into a problem, that causes pdt to crash eclipse. If I close the editor-tab with my file, it asks to save or loose changes, and this dialog runs in an endless loop, whatever button I click the dialog asks me again.

I attached a screenshot how my eclipse looks then. I didn't modify it to rule something out, this is really how my eclipse looks.

Reproducible: Couldn't Reproduce
Comment 1 gossi CLA 2011-09-29 15:56:14 EDT
Created attachment 204326 [details]
This is what happens to my eclipse. Screenshot is not modified!
Comment 2 julien CLA 2011-10-19 15:36:05 EDT
Hi,

I'm having something that seems to be the same issue, on OS X Lion
To reproduce: create a simple php file containing this:
<html>
<body>
<?php foreach($foo as $bar) { ?>

<?php } ?>
</body>
</html>


Then, just try to add HTML code in the blank space between the two <?php ?>  <?php ?> nodes.
It should screw up the editor.
Comment 3 barduck CLA 2011-10-27 06:25:14 EDT
I can confirm this on Mac OSX 10.7.2 with Eclipse 3.7.1 and PDT 3.0.0.v20110516

I can't reproduce this consistently but I noticed that the problem usually appears when starting to type an html element in a php file above an existing <?php ... ?> code.

I can usually get away with this if I close the file without saving and reopen it but if I continue editing it, sometimes it crashes Eclipse and leads to the situation gossi described (as shown in his screenshot).
Comment 4 stuart.brockman CLA 2011-11-25 08:53:22 EST
I have a file which does this consistently, but I have been unable to reduce it to a simple test-case and I'm unsure about releasing my employer's code.

When re-opening Eclipse, it refuses to open the affected file with "Could not open the editor: Aborted cyclic load attempt for model with id: /name/and/path/of/file.php". It sometimes also refuses to open any other php files with the same error (including the "bad" file's path, not the path of the file I'm actually trying to open).

I have attached the a file containing the full exception details.
Comment 5 stuart.brockman CLA 2011-11-25 08:55:05 EST
Created attachment 207535 [details]
Details of exception preventing file re-opening after restarting eclipse.

File path redacted.
Comment 6 Dave CLA 2011-12-22 11:45:45 EST
I'm having the exact same problem. I'm on Ubuntu Linux 11.10 running Eclipse SDK Version: 3.7.1 Build id: M20110909-1335. Happy to provide any information needed.
Comment 7 Ian Lovett CLA 2012-01-02 22:13:42 EST
I am getting a similar problem as described by julien.

<?php foreach($list as $i): ?>
<?php endforeach; ?>

Any attempt to write a new php opening tag (starting to with <) BETWEEN php tags and my editor gets very screwy and puts in a bunch of characters in the incorrect order and the line numbers disappear...

I discovered if I write another non-whitespace character and then attempt to open a php tag after, it works fine and then I can erase the character I entered.

I am running

Mac OSX Snow Leopard
Eclipse 3.7.1
PHP Development Tools (PDT) SDK Feature	3.0.0.v20110516-1100-77--84
Comment 8 Mike Kissinger CLA 2012-01-11 15:41:52 EST
I seem to be having this issue as well. I'm on Windows 7 64 running Eclipse Indigo. 

Only one file seems to be impacted. When opening that file, I get: 

Could not open the editor: Aborted cyclic load attempt for model with id: /file/path/file.php

The problem file appears to be OK when opened in Notepad. It also started showing up in the PHP Explorer at the root level of my project. If I try to open it from there, I get the message above, with the same (correct) file path. I'd be glad to provide a screenshot or stack trace if desired. It might also be worth mentioning that I have an (apparently) hung PHPTaskValidator process running.
Comment 9 Florian Kraft CLA 2012-01-19 08:36:29 EST
I am experiencing the very same problem Ian Lovett described, using the very same setup he uses.
I'm happy to provide any additional information, if needed.

the Problem is reproducible and results vary between being unable to use the PHP Editor for editing normal (as in "pure" html-free) php files to the complete IDE crashing (in the fashion seen in stuart.brockman@jadu.co.uk's screenshot)
Comment 10 Kenneth Skertchly CLA 2012-03-15 15:07:03 EDT
This is happening to me too. I haven't found a way to fix it, and the only way I can open the file inside Eclipse is if I right click on the file in the project explorer, and open with text editor. I was editing HTML within "alternate style" PHP conditional statements when it happened:

<?php if($totalRows <= 0): ?>
<table>
.
.
.

When I tried to close the <table> tag, the editor just started to act weird so I saved the file and closed it. I immediately tried to open the file again, but all I got was this:

Could not open the editor: Aborted cyclic load attempt for model with id: /path/to/file.php

I also tried closing the project and restarting Eclipse, but it didn't help.
Comment 11 Kenneth Skertchly CLA 2012-03-15 15:08:36 EDT
Forgot to mention, I am running Eclipse Version: 3.7.0 on Linux Mint 12.
Comment 12 Mike Kissinger CLA 2012-03-15 15:16:27 EDT
Update: I've moved to Eclipse for PHP Developers v 3.0.2 and haven't seen this issue since.
Comment 13 Kenneth Skertchly CLA 2012-03-15 15:25:09 EDT
Mike,
Thanks for the suggestion! Used the "Check for updates" in the Help menu to update PDT, and the issue disappeared.
Comment 14 Roy Ganor CLA 2012-03-23 07:40:29 EDT
fixed as verified by the user
Comment 15 Sylvia Tancheva CLA 2012-07-03 10:41:32 EDT
I could not reproduce any of the examples on Mac Snow Leopard 10.6. Closing...
Ilina Stefanova