doufenpaiyu63706 2017-11-13 16:35
浏览 191
已采纳

filemanager插件 - TinyMCE - 服务器响应不是JSON格式

recently we updated a server from php 5.3 to php 7, actually I don't know if the update causes this issue, but when I go to insert a file on TinyMCE javascirpt I receive this error message:

The server response wasn't JSON format

I haven't found anything on internet about it.

here is Json_data:

{"method":"fm.insertFiles","params":[{"path0":"{0}/Sage.JPG"}],"id":"c0"}

here is TinyMCE configuration:

    tinyMCE.init({
    // General options
        mode : "exact",
        elements : "msg_body",
    theme : "advanced",
    theme_advanced_resizing_max_width : 530,
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,spellchecker,filemanager",

    // Theme options
    theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,|,styleselect,formatselect,|,forecolor,backcolor,<?if ($staff[perm][msg_replies]==1) {?>|,insertfile,link,<?}?>|,spellchecker",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,

    //External
    extended_valid_elements : "iframe[src|width|height|name|align]",

    // Example content CSS (should be your site CSS)
    content_css : "../style-bijou.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "lists/template_list.js",
    external_link_list_url : "lists/link_list.js",
    external_image_list_url : "cms-image_list.php",
    media_external_list_url : "lists/media_list.js",

    // Style formats
    style_formats : [
        {title : 'Bijou Weddings styles'},
        {title : 'Bijou copy', block : 'p', classes : 'copy'},
        {title : 'Bijou copy bold', inline : 'span', classes : 'title'},
        {title : 'Corporate Event styles'},
        {title : 'Event bullets small', block : 'p', classes : 'corpbodybull'},
        {title : 'Event bullets big', block : 'p', classes : 'corpbull'},
        {title : 'Table styles'},
        {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
    ],

    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }

});

Do you have any idea please? thanks

  • 写回答

2条回答 默认 最新

  • dongxian6285 2017-11-14 11:47
    关注

    I finally found the problem,

    The plugin "filemanager" generate a php error, the file History.php located in folder /plugins/filemanager/plugins/History is using a php function called split which is obsoleted for php7.

    So I swap the function split with function explode. Now the file inserting is working properly.

    Hope this will be useful.

    here is the explanation in php.net: http://php.net/manual/en/function.split.php and http://php.net/manual/en/function.explode.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退