When I enable elfinder module elfinder-7.08 (with elfinder library 1.2) OR elfinder-7.2x-dev (with elfinder library 2.1), my site is broken with json data when I cleare all cache or access "admin/modules". I found that elfinder alway print " echo json_encode($this->_result); in function run() { } of elFinder.class.php " when $mode = 'default' .
/**
* File browser to filesystem php connector callback for elfinder 7.2x-dev
*/
function elfinder_connector($mode = NULL) {
if (is_null($mode) && !isset($_GET['cmd'])) {
return;
}
global $base_root, $user;
like this:

/**
 * File browser to filesystem php connector callback
 */
function elfinder_connector($mode = NULL) {
    if (is_null($mode) && !isset($_GET['cmd'])) {
        return;
    }
    global $base_root, $user;
    
    /**
     * Emulate json_encode required by filesystem connector for old php without JSON support
     */
    if (!function_exists('json_encode')) {
.............................

All changes are in attached file. elfinder 7.08

Comments

trong.nguyen.tcec’s picture

My code patch also works on elfinder 7.2x-dev

trong.nguyen.tcec’s picture

Issue summary: View changes
StatusFileSize
new170.92 KB
ph0enix’s picture

Title: elfinder breaks the Commerce Distribution ( 7.24 - drupal core 7.27) » [patch] elfinder breaks the Commerce Distribution ( 7.24 - drupal core 7.27)
Status: Active » Patch (to be ported)
ph0enix’s picture

Version: 7.x-0.8 » 7.x-2.x-dev
ph0enix’s picture

Status: Patch (to be ported) » Closed (duplicate)

Moved #24