core icon indicating copy to clipboard operation
core copied to clipboard

Newly created text file cannot be edited (5.0.9)

Open torlasz opened this issue 13 years ago • 10 comments

If I create a text file in OC in the web interface (with or without txt extension) it gets created with zero length, but clicking on it results in a download attempt, rather then opening the text editor. If I upload a text file to OC (any size, can be 0 length) rather then create it in the web interface, it works as expected: clicking on the name opens the text editor.

This is OC 5.0.9, on RHEL 6.4.

torlasz avatar Jul 17 '13 07:07 torlasz

I have exactly the same experience. When I create new text file, it has white blank icon on the left and it is not possible to edit it, just download it. Older files created in the same way do not have any problem like this.

OC 5.0.9. on Debian 7

PS: Updating to this version was finally working like a charm, good work.

liska12 avatar Jul 17 '13 09:07 liska12

@tomneedham issues with texteditor?

Niduroki avatar Jul 17 '13 17:07 Niduroki

To better backtrace: This just occurs right after the creation. If the folder is reloaded, the text file opens in texteditor, like it should.

MorrisJobke avatar Jul 18 '13 12:07 MorrisJobke

I have tested with the new version : {"installed":"true","version":"5.0.15","versionstring":"5.0.9","edition":"Enterprise"}

and I have reproduced it.

luciamaestro avatar Jul 19 '13 08:07 luciamaestro

Warning PHP Undefined index: mime at /var/www/html/owncloud/apps/files/ajax/mimeicon.php#3  July 21, 2013 23:57
Warning search_lucene   failed to extract meta information for /user/files/test: unable to determine file format    July 21, 2013 23:57
Error   search_lucene   need mimetype for content extraction    July 21, 2013 23:54

moneytoo avatar Jul 21 '13 21:07 moneytoo

I am also getting this using Firefox 22. Previously it was working just fine.

johndevs avatar Jul 28 '13 13:07 johndevs

Reported in our forums as well. See https://forum.owncloud.org/viewtopic.php?f=23&t=13547

rakekniven avatar Jul 31 '13 15:07 rakekniven

I run ownCloud on Centos 6 and Synology NAS (ARM). On both machines, I experience described issue since version 5.0.8.

If I download release 5.0.7 it works fine. However if I clone ownCloud core and 3rdparty from git and reset to point of release 5.0.7 it has also that issue - and lower releases as well.

In ownCloud 5.0.8 and 5.0.9 I can make the issue disappear if I comment out following line: https://github.com/owncloud/core/blob/stable5/apps/files/index.php#L29 OCP\Util::addscript('files', 'file-upload');

moneytoo avatar Aug 05 '13 21:08 moneytoo

To fix the issue, manually specify mime type - the same way it was up to 5.0.7. Replace https://github.com/owncloud/core/blob/stable5/apps/files/js/file-upload.js#L261 with

tr.attr('data-mime','text/plain');

moneytoo avatar Aug 09 '13 08:08 moneytoo

Fixed in latest ownCloud 5.0.x releases and ownCloud 6

karlitschek avatar Oct 18 '13 10:10 karlitschek