[5.0.10 RC1] Right after creating a txt, by clicking on it, it´s downloaded
Expected behaviour
If you create a new txt file, by clicking on it, it has to be open
Actual behaviour
If you create a new txt file, by clicking on it, it is downloaded
Steps to reproduce
- Log in oc
- Create a new txt
- Click on it
- Download menu is shown
Server configuration
{"installed":"true","version":"5.0.16","versionstring":"5.0.10 RC1","edition":""} Suse 12.2
Client configuration
Browser: FF
reported too on the apps mail:
"Hello,
I have discovered a little bug in owncloud V 5.0.9. If I create a txt file from the GUI, I am not able to edit it. I have to switch to another directory and to come back to the original directory to edit the file.
For exemple:
root---|dir 1 |dir 2
I create a txt file in dir1 root---|dir 1..|test.txt
If I click on test.txt just after the creation, the file is downloaded and I can't edit it from the GUI.
I have to go to dir2 and to go back to dir1."
Thanks Remy
@bantu @VicDeo @ringmaster can you please have a look? THX
Hi,
also reproduce able with OC 5.0.9 at http://demo.owncloud.org/
When the new file is created the mimeicon is missing at this file. After refreshing the folder the new created file has the correct mimeicon of a text file.
Some log snippets:
Creating the file and clicking on it:
[15:34:06.523] POST http://demo.owncloud.org/index.php/apps/files/ajax/newfile.php [HTTP/1.1 200 OK 2858ms]
[15:34:09.490] GET http://demo.owncloud.org/index.php/apps/files/ajax/mimeicon.php [HTTP/1.1 200 OK 89ms]
[15:34:19.346] GET http://demo.owncloud.org/index.php/apps/files/download//test2.txt [HTTP/1.1 200 OK 168ms]
Clicking on the file after reloading the folder:
[15:34:43.257] GET http://demo.owncloud.org/index.php/apps/files_texteditor/ajax/loadfile.php?file=test2.txt&dir=%2F [HTTP/1.1 200 OK 87ms]
[15:34:43.381] POST http://demo.owncloud.org/index.php/core/ajax/translations.php [HTTP/1.1 200 OK 81ms]
[15:34:43.601] GET http://demo.owncloud.org/apps/files_texteditor/js/aceeditor/theme-clouds.js?_=1375968883465 [HTTP/1.1 200 OK 49ms]
I am able to reproduce this on stable5.
@RealRancor I think the icon is correct. core/img/filetypes/file.png is used for empty files, core/img/filetypes/text.png is used for text files.
@bantu I wasn't sure if this is connected with that problem but just want to post as much infos as possible. :-)
But this icon will change event if there is no content in this text file after the refresh.
@RealRancor It does not seem to change for me.
@bantu Mhhh, just did another test at demo.owncloud.org (because of the lack of an OC 5.0.x installation) and had a look at the source code (with the sourcechart plugin for ff) of the page during the test:
Creating the new file:
<tr data-id="25212" data-permissions="31" data-file="test.txt" data-size="0" data-type="file">
<td style="background-image:url(/core/img/filetypes/file.png)" class="filename ui-draggable">
<input type="checkbox">
<a href="/index.php/apps/files/download//test.txt" class="name">
<span class="nametext">
test
<span class="extension">
.txt
</span>
</span>
*snip*
</tr>
Refreshing the folder without adding anything to the new created file:
<tr data-id="25212" data-file="test.txt" data-type="file" data-mime="text/plain" data-size="0" data-permissions="27">
<td class="filename svg ui-draggable" style="background-image:url(/core/img/filetypes/text.png)">
<input original-title="" type="checkbox">
<a class="name" href="/index.php/apps/files/download//test.txt" title="">
<span class="nametext">
test
<span class="extension">
.txt
</span>
</span>
*snip*
</tr>
You probably note the missing "data-mime="text/plain"" in the first run before refreshing the page and the difference between the file.png and text.png icons.
Confirmed on my local stable5 checkout. When adding a new text file, clicking the newly created file results in a download. The table row for the file does not contain a mimetype. When modifying the table row directly via the inspector to add data-mime="text/plain", clicking the row then produces the editor, just like it does on page reload.
Please have a look at PR #4361 which should fix this.