• Resolved George

    (@trustgovernance)


    I just uploaded to the latest version and now have problems with preview. The following appears in the Preview window multiple times. Could this be a consequence of the latest revision or some other glitch?

    <div class=”error” style=”clear:both;”>
    <div id=”mdocs-error”>
    <p><b>Memphis Error: </b>Something when wrong, and your download has failed.</p>
    </div>
    </div>

    <b>Warning</b>: Cannot modify header information – headers already sent by (output started at /home/geogra19/library.ssiwatersheds.ca/wp-content/plugins/memphis-documents-library/mdocs-functions.php:351) in <b>/home/geogra19/library.ssiwatersheds.ca/wp-content/plugins/memphis-documents-library/mdocs-downloads.php</b> on line <b>46</b>

    https://ww.wp.xz.cn/plugins/memphis-documents-library/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author bhaldie

    (@bhaldie)

    try this to see if preview will work, open the file mdocs-downloads.php and change this:

    } elseif($is_google == false || $is_box_view == false) {
    		mdocs_errors(__('Something when wrong, and your download has failed.'), 'error');
    	}

    to this

    }

    let me know what you see.

    Thread Starter George

    (@trustgovernance)

    When I navigate to the website I now get this error message:

    Parse error: syntax error, unexpected ‘}’ in /home/geogra19/library.ssiwatersheds.ca/wp-content/plugins/memphis-documents-library/mdocs-downloads.php on line 64

    Plugin Author bhaldie

    (@bhaldie)

    change it back to the original

    You must have deleted too many }

    Thread Starter George

    (@trustgovernance)

    I have done but am still getting a syntax error.

    Here is the string . . .

    } elseif(isset($_GET[“mdocs-file”])) {
    $the_mdoc = get_the_mdoc_by($_GET[“mdocs-file”], ‘id’);
    $is_allowed = mdocs_check_file_rights($the_mdoc, false);
    $filename = $the_mdoc[‘filename’];
    $file = $upload_dir[‘basedir’].’/mdocs/’.$filename;
    } elseif($is_google == false || $is_box_view == false) {
    mdocs_errors(__('Something when wrong, and your download has failed.'), 'error');

    }
    // COUNT THE DOWNLOAD
    if($is_allowed && !isset($_GET[‘mdocs-export-file’]) && !isset($_GET[‘mdocs-version’]) && $is_box_view === false && $is_google === false) {
    $mdocs[$the_mdoc[‘index’]][‘downloads’] = intval($mdocs[$the_mdoc[‘index’]][‘downloads’])+1;
    mdocs_save_list($mdocs);

    Plugin Author bhaldie

    (@bhaldie)

    Everything looks fine, copy this:

    // CHECK TYPE OF DOWNLOAD
    	if(isset($_GET['mdocs-export-file']) ) {
    		$is_allowed = mdocs_check_file_rights(null, false);
    		$filename = basename($_GET['mdocs-export-file']);
    		$file = sys_get_temp_dir().'/'.$filename;
    	} elseif(isset($_GET['mdocs-version']) ) {
    		$the_mdoc = get_the_mdoc_by(basename($_GET['mdocs-file']), 'id');
    		$is_allowed = mdocs_check_file_rights($the_mdoc, false);
    		$file = basename($_GET['mdocs-version']);
    		$filename = substr(basename($_GET['mdocs-version']), 0, strrpos(basename($_GET['mdocs-version']), '-'));
    	} elseif(isset($_GET["mdocs-file"])) {
    		$the_mdoc = get_the_mdoc_by($_GET["mdocs-file"], 'id');
    		$is_allowed = mdocs_check_file_rights($the_mdoc, false);
    		$filename = $the_mdoc['filename'];
    		$file = $upload_dir['basedir'].'/mdocs/'.$filename;
    	} elseif($is_google == false || $is_box_view == false) {
    		mdocs_errors(__('Something when wrong, and your download has failed.'), 'error');
    	}

    if all else fails download mDocs and FTP into your site and overwrite the file.

    Thread Starter George

    (@trustgovernance)

    I overwrote the file and now have access to the site. The Preview problem remains. I Just uploaded a trial document to see if it was only existing files that were affected but new uploads also show the problem. I’ve very few other plugins and haven’t updated the theme lately so am at a loss as to how to resolve.

    Plugin Author bhaldie

    (@bhaldie)

    The error is occurring because for some reason the preview get trigger is not firing. There are a number of reasons that this could be happening and it can’t be narrowed down from this error.

    More than likely it is a server configuration that is previewing the get request from firing.

    Open a browser debugger an make sure you don’t see any javascript errors.

    Thread Starter George

    (@trustgovernance)

    The error console shows a couple items but no javascript errors.

    ‘Failed to load resource: the server responded with a status of 404 (HTTP/2.0 404) ‘

    ‘WebSocket connection to ‘wss://public-api.wordpress.com/plugin/wpcom/me/newest-note-date” failed: Unexpected response code: 403. ‘

    Plugin Author bhaldie

    (@bhaldie)

    What preview are you using google or box?

    Thread Starter George

    (@trustgovernance)

    Google

    Thread Starter George

    (@trustgovernance)

    Box are no longer accepting new sign ups to View API.

    Plugin Author bhaldie

    (@bhaldie)

    hmmm….

    Can we test code again

    let go back to this:

    } elseif($is_google == false || $is_box_view == false) {
        mdocs_errors(__('Something when wrong, and your download has failed.'), 'error');
    }

    and change it to this:

    } elseif($is_google == false || $is_box_view == false) {
        //mdocs_errors(__('Something when wrong, and your download has failed.'), 'error');
    }

    Thread Starter George

    (@trustgovernance)

    That did the trick. Thank you.

    Thread Starter George

    (@trustgovernance)

    Should have marked this resolved.

    Plugin Author bhaldie

    (@bhaldie)

    so preview is working now?

Viewing 15 replies - 1 through 15 (of 17 total)

The topic ‘problems with preview’ is closed to new replies.