core icon indicating copy to clipboard operation
core copied to clipboard

No text editor (Ace) with new textfiles after upgrading to beta5

Open Hausmarke opened this issue 13 years ago • 16 comments

The text editor with new files does not work -> file is download only.

When i make a new texxtfile and click on it afterwards the editor does not start - instead the webinterface offers the file for download. With old/formerly made textfiles i can open the file once, but after i save the file its the same as above...

running Ubuntu Linux 12.04.2,Apache version 2.4.6 , MySQL version 5.5.32

Hausmarke avatar Nov 25 '13 18:11 Hausmarke

@karlitschek hmmm - maybe related to the changes on the mime type detection?

DeepDiver1975 avatar Nov 25 '13 18:11 DeepDiver1975

Today on master I was able to edit text files.

Did you also upgrade the apps repository ?

Is there any error in the Chrome/Firefox console on page load ?

PVince81 avatar Nov 25 '13 22:11 PVince81

I did upgrade via the link in the mailing list... do i have to upgrade the apps repository to for the ace editor? I thought that this is part of the core?

and no - there is no major error in the console...

Strange is also that any older textfiles still have their Textfile-Icon made from a preview of the file. And after i open the textfile and close it afterwards the icon is also gone...

Hausmarke avatar Nov 25 '13 22:11 Hausmarke

@Hausmarke the text editor is part of the apps repo, not core. Please try to upgrade that one as well. :smile:

PVince81 avatar Nov 26 '13 08:11 PVince81

No i´ve overwritten the whole package and it works again - obviously there where a micture between files in different versions.. thanks anyway!

Hausmarke avatar Nov 26 '13 09:11 Hausmarke

I reopened it because after overwriting all files with beta5 again the text editing works now - but still adding a new textfile over the webinterface does not work...

When i make a new textfile i got the following messages: Debug core OC_Image->fixOrientation() Orientation: -1 2013-11-27T00:24:38+00:00 Debug core Generating preview for "/testfile-new" with "OC\Preview\Unknown" 2013-11-27T00:24:38+00:00 Error PHP RecursiveDirectoryIterator::__construct(/6TB/owncloud-data/Username/thumbnails/2937/): failed to open dir: No such file or directory at /var/www/owncloud/lib/private/files/storage/local.php#44 2013-11-27T00:24:38+00:00 Debug core OC_Image->fixOrientation() Orientation: -1 2013-11-27T00:24:38+00:00 Debug core Generating preview for "/testfile-new" with "OC\Preview\Unknown" 2013-11-27T00:24:38+00:00 Error PHP RecursiveDirectoryIterator::__construct(/6TB/owncloud-data/Username/thumbnails/2937/): failed to open dir: No such file or directory at /var/www/owncloud/lib/private/files/storage/local.php#44

And whe i try open it... Error PHP chmod(): Operation not permitted at /var/www/owncloud/lib/private/log/owncloud.php#74 2013-11-27T00:28:50+00:00 Warning PHP filemtime(): stat failed for /6TB/owncloud-data/Username/thumbnails/2439 at /var/www/owncloud/lib/private/files/storage/local.php#127 2013-11-27T00:28:50+00:00

Hausmarke avatar Nov 27 '13 00:11 Hausmarke

Overwriting files is not a good idea in general as it could have side effects.

Are you using any external storage ? Does the file appear in the file list ? After refreshing the page ? Do you see any errors in the browser console when creating the file ?

PVince81 avatar Nov 27 '13 09:11 PVince81

@Hausmarke do you have the php module fileinfo installed? Just a wild guess

DeepDiver1975 avatar Nov 27 '13 09:11 DeepDiver1975

Debug core Generating preview for "/testfile-new" with "OC\Preview\Unknown" 2013-11-27T00:24:38+00:00

This indicates that the file is not recognized as a text file - can you retry with a new file containing the file extension .txt

DeepDiver1975 avatar Nov 27 '13 09:11 DeepDiver1975

Yes i have fileinfo installed - editing worked fine in beta4. @installing: i install the new versions of OC always the same way - deleting all files and folders but the "config" and the "themes" than copiing all the new files over to the webspace. I dont use external storage After building a new textfile it appears on the file list also after refreshing the page - i took a look on the physical folder and its there...

i don´t see any errors but look by yourself:

------>Creating a new file "testfile4": [10:19:29.051] POST http://hostname.bla.bla/index.php/apps/files/ajax/newfile.php [HTTP/1.1 200 OK 637ms] [10:19:29.727] GET http://hostname.bla.bla/index.php/core/preview.png?x=36&y=36&file=%2F!test%2Ftestfile4&c=5295b92011437 [HTTP/1.1 200 OK 29ms]

------>try to open it by normal clicking on it: [10:20:53.187] GET http://hostname.bla.bla/index.php/apps/files/download/!test/testfile4 [HTTP/1.1 200 OK 18ms]

------>This is how it looks like when i open a formerly made textfile - the editor starts normal: [10:21:16.774] GET http://hostname.bla.bla/index.php/apps/files_texteditor/ajax/loadfile.php?file=werwrewr&dir=%2F!test [HTTP/1.1 200 OK 19ms] [10:21:16.774] POST http://hostname.bla.bla/index.php/core/ajax/translations.php [HTTP/1.1 200 OK 18ms] [10:21:16.899] GET http://hostname.bla.bla/apps/files_texteditor/js/vendor/ace/src-noconflict/theme-clouds.js?_=1385543904818 [HTTP/1.1 200 OK 4ms]

Hausmarke avatar Nov 27 '13 09:11 Hausmarke

When i make a new textfile with the extension .txt it works!!! When i rename one of my problemfiles and add a .txt it´s still the same...

Hausmarke avatar Nov 27 '13 09:11 Hausmarke

What if you refresh the page after renaming the file from no extension to .txt ? If that doesn't work it means that mimetype detection hasn't been re-triggered after renaming and needs to be fixed.

PVince81 avatar Nov 27 '13 09:11 PVince81

If that doesn't work it means that mimetype detection hasn't been re-triggered after renaming and needs to be fixed.

I just had the same observation - mimetype is not redetected on rename (I guess also not on content change)

DeepDiver1975 avatar Nov 27 '13 09:11 DeepDiver1975

Refresh does not have any impact on the problem.

Hausmarke avatar Nov 27 '13 09:11 Hausmarke

Had a chat with @karlitschek and we decided to fix it like this:

  1. Make "txt" the default file type when creating a new file from the UI. I suggest to make it so that the ".txt" is already present in the field when it appears but the cursor starts on the left of it. (CC @owncloud/designers for feedback) This is to prevent the confusion about people thinking they are creating text files but the file has no extension.

  2. Fix mimetype detection on rename

PVince81 avatar Nov 27 '13 17:11 PVince81

Let's address 1) here.

I've raise 2) as a separate issue: https://github.com/owncloud/core/issues/6087

PVince81 avatar Nov 27 '13 17:11 PVince81