keystonejs/keystone-classic

Keystone deletes keys that have a function as a value when setting options for TinyMCE

Open

#3,728 opened on Nov 23, 2016

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (2,288 forks)batch import
bughelp wanted

Repository metrics

Stars
 (14,656 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Steps to reproduce the behavior

  1. Install an external plugin like tinyvision
  2. Configure Keystone to use it. The relevant configuration might look like this:
keystone.init({
    // ...
    'wysiwyg additional options': {
        external_plugins: {
            tinyvision: '/admin/js/lib/tinymce/plugins/tinyvision/plugin.min.js'
        },
        tinyvision: {
            source: '/api/assets',
            upload: function() {}
        }
    }
});
  1. Create a route to intercept the request and load the plugin. The approach has been described in this comment.
  2. Inspect the options passed to the plugin

Expected behavior

All the options should be passed

Actual behavior

Options that have a function as a value are deleted. To confirm this, try to set the value of upload to a number or a string and it'll be present.

Contributor guide