Value should be a js string but was not being encoded as such.

The editor button 'image' pops up a dialog that allows you to navigate the media manager's files. There's a `select` in this dialog full of directories that you might want to navigate to but it doesn't work. This is because of a php string being inserted into js code as-is. It needs to be json encoded (typically this just means putting it in quotes) first.