Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing JSON text files downloads them instead of opening in web-based text editor for editing #1177

Closed
viharm opened this issue Aug 29, 2016 · 3 comments
Assignees
Labels

Comments

@viharm
Copy link

viharm commented Aug 29, 2016

Steps to reproduce

  1. Navigate to a location containing a text file (e.g., page.json)
  2. Click on page.json

Expected behaviour

Prompt to save file appears

Actual behaviour

Web-based text editor should open. This works as expected with some text files (e.g., .php, .c, etc.)

Server configuration

Operating system: Debian GNU/Linux Jessie 8.4 (kernel 3.16.0-4-amd64)

Web server: Apache 2.4.10-10+deb8u4

Database: MySQL 5.5.49-0+deb8u1

PHP version: 5.6.20+dfsg-0+deb8u1

Nextcloud version: 10.0 (stable)

Updated from an older Nextcloud/ownCloud or fresh install: Fresh install

Where did you install Nextcloud from: Standalone files package obtained from Nextcloud

Signing status:

Signing status

No errors have been found.

List of activated apps:

App list

Enabled:
  - activity: 2.3.2
  - calendar: 1.3.3
  - comments: 1.0.0
  - contacts: 1.3.1.0
  - dav: 1.0.0
  - documents: 0.13.1
  - federatedfilesharing: 1.0.1
  - federation: 1.0.1
  - files: 1.5.2
  - files_external: 1.0.2
  - files_pdfviewer: 0.8.1
  - files_sharing: 1.0.0
  - files_texteditor: 2.1
  - files_trashbin: 1.0.0
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 15.0.0
  - mail: 0.5.2
  - notifications: 0.3.0
  - password_policy: 1.0.0
  - provisioning_api: 1.0.0
  - serverinfo: 1.1.1
  - survey_client: 0.1.5
  - systemtags: 1.0.2
  - tasks: 0.9.3
  - theming: 1.0.1
  - updatenotification: 1.0.1
  - user_ldap: 1.0.1
  - workflowengine: 1.0.1
Disabled:
  - admin_audit
  - encryption
  - external
  - files_accesscontrol
  - files_automatedtagging
  - files_retention
  - templateeditor
  - user_external
  - user_saml

The content of config/config.php:

Config report

{
    "system": {
        "instanceid": "oc6nu15kjxj4",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "SERVERHOSTNAME",
            "SERVERIPADDRESS",
            "DOMAINNAME"
        ],
        "datadirectory": "DATADIR",
        "overwrite.cli.url": "WEBURL",
        "dbtype": "mysql",
        "version": "9.1.0.16",
        "dbname": "DATABASENAME",
        "dbhost": "localhost",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory"
    }
}

Are you using external storage, if yes which one: Local; SFTP

Are you using encryption: yes

Are you using an external user-backend, if yes which one: LDAP

LDAP configuration (delete this part if not used)

LDAP config

Information appears irrelevant, but available on request.
### Client configuration

Browser: Firefox 48.0.2, Chrome 52.0.2743.116

Operating system: Windows 10 Pro x86-64

Logs

Web server error log

Web server error log

CLIENT.IP - - [29/Aug/2016:22:44:27 +0100] "GET /NEXTCLOUD-URI/index.php/apps/files/ajax/getstoragestats.php?dir=STORAGE-RESOURCE-DIR HTTP/1.1" 200 5029 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
CLIENT.IP - - [29/Aug/2016:22:44:27 +0100] "GET /NEXTCLOUD-URI/remote.php/webdav/STORAGE-RESOURCE-DIR/Page.json HTTP/1.1" 200 29085 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
CLIENT.IP - - [29/Aug/2016:22:44:29 +0100] "GET /NEXTCLOUD-URI/ocs/v2.php/apps/notifications/api/v1/notifications?format=json HTTP/1.1" 200 1067 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
#### Nextcloud log (data/nextcloud.log)

Nextcloud log

When clicking on a PHP file

{"reqId":"RD2ludlOxi1q1JW5u\/bV","remoteAddr":"CLIENT.IP","app":"PHP","message":"rewinddir(): 135 is not a valid Directory resource at \/NEXTCLOUD-DIR-PATH/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#31","level":0,"time":"2016-08-29T22:03:08+00:00","method":"GET","url":"\NEXTCLOUD-URI/index.php\/apps\/files_texteditor\/ajax\/loadfile?filename=index.php&dir=%2FEXT-STORE-NAME%2FSUBJECT-PATH","user":"USER-UUID"}

When clicking on a JSON file

{"reqId":"UurBh98L6EVNpXvjarmV","remoteAddr":"CLIENT.IP","app":"PHP","message":"rewinddir(): 90 is not a valid Directory resource at \/NEXTCLOUD-DIR-PATH/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#31","level":0,"time":"2016-08-29T22:03:13+00:00","method":"GET","url":"\NEXTCLOUD-URI/remote.php\/webdav\/EXT-STORE-NAME\/SUBJECT-PATH/Page.json","user":"USER-UUID"}
#### Browser log

Browser log

Appears irrelevant, but available on request.
@nickvergessen
Copy link
Member

In case you want to help testing: nextcloud/files_texteditor@2f150fb

@viharm
Copy link
Author

viharm commented Aug 30, 2016

Thanks, I tried this by editing the changed lines manually and it appears to work. I am eagerly awaiting Nextcloud 11 for this to be mainstream :-)

Is it not possible for text editor to self-configure based on the global mimetypemappings.json or mimetypealiases.json?

May be parse these global mimetype files, eg. for text, text/html, text/code, etc.?

@nickvergessen
Copy link
Member

Hmm better save then sorry,

we also made the changes to 10.0.1 and 9.0.54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants