directus / v8-archive

Directus Database API — Wraps Custom SQL Databases with a REST/GraphQL API
https://docs.directus.io/api/reference.html
507 stars 203 forks source link

Cannot add advanced options to WYSIWYG field #2203

Open ComputerCarl opened 4 years ago

ComputerCarl commented 4 years ago

Using version 8.5.5

If I create a new field of type WYSIWYG, I can add the code below in the Options -> Advanced Options -> TinyMCE Options. It will work as expected and spellcheck will be performed while typing.

However, I cannot add the option after the field exists.

When trying to save, I get the error;

"Trouble processing the request. Try again after refreshing the page."

TinyMCE options;

{
  "browser_spellcheck": true
}

Also;

benhaynes commented 4 years ago

@rijkvanzanten — I assume this is App since it's an interface?

rijkvanzanten commented 4 years ago

I'm assuming it's API as saving of a new option is going wrong, I don't think it's inherently related to the WYSIWYG actually 🤔

@ComputerCarl could you share the network request from the devtools? I'm wondering what the payload / response was for this request

ComputerCarl commented 4 years ago

Thanks for taking a look into this!

PATCH /_/fields/pages/content HTTP/1.1
Host: directus.mydomain.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://directus.mydomain.com/admin/
Content-Type: application/json;charset=utf-8
X-Directus-Project: _
Content-Length: 635
Cookie: PHPSESSID=d4b32cd1[modified]033752dsfdse40ab; directus-_-session=2XWmSHAFgeOGMpZlq1tIMoIQRJGGnhmvHtEx%3A%3A3baa13kwerwi[modified]2a50e0cfd8
DNT: 1
Connection: keep-alive

HTTP/2.0 422 No Reason Phrase
content-type: application/json
date: Mon, 13 Apr 2020 03:48:10 GMT
server: Apache/2.4.38 (Debian)
x-powered-by: PHP/7.3.14
content-length: 245
X-Firefox-Spdy: h2

{"error":{"code":404,"message":"Statement could not be executed (42000 - 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(16777215) Null' at line 1)"}}

Docker-Compose;

    directus.db:
        image: mysql:5.7
    directus:
        build: ../directus-custom
        depends_on: 
            - directus.db

Directus Dockerfile;

FROM directus/directus:v8-apache
COPY ./uploads.ini /usr/local/etc/php/conf.d

Conf.d;

file_uploads = On
memory_limit = 16M
upload_max_filesize = 16M
post_max_size = 64M
max_execution_time = 600
TJZenkai commented 4 years ago

I am having the same issue/error when I try to add TinyMCE options through the UI interface. Once this is functional I am also curious on how we would add premium plugins to the tinyMCE in directus.

danieljwestman commented 4 years ago

Anyone getting the advanced options going for TinyMCE? I would like to add a premium plugin. I'm in v9 if that makes any difference...