ProjectCleverWeb / Semantic-UI-WordPress

This project incorporates Semantic UI into a starter (aka developer) theme for WordPress.
Other
275 stars 59 forks source link

Uploading image issue #38

Closed Ralphkay closed 8 years ago

Ralphkay commented 8 years ago

Please, I made a child theme out of semantic-UI-WordPress theme, however when I try uploading images or any media, it fails to upload. Please Can I get some help with this issue. Thank you.

ProjectCleverWeb commented 8 years ago

To help rule out errors, can you please make sure all plugins are disabled.

Additionally, when it fails, what does it say? Does the console produce any errors? (Console can be opened with F12 in Chrome)

krishaamer commented 8 years ago

+1

The uploads fail on a clean install with 0 plugins activated. Both on localhost and remote server. The WP errors are not really descriptive. JS console doesn't show any errors.

screen shot 2016-04-05 at 01 59 30

ProjectCleverWeb commented 8 years ago

An update will be push out soon, but here is a fix for you guys for now:

In include/class/semantic/shutdown.php at about line 88, change this:

public function _run_shutdown() {
    global $debug;
    foreach ($this->jobs as $id => $job) {
        $debug->runtime_checkpoint(sprintf('[Theme] Shutdown - Running "%s"...', $id));
        call_user_func_array($job['callback'], $job['args']);
    }
    $this->jobs = array();
}

To This:

public function _run_shutdown() {
    if (in_array($GLOBALS['pagenow'], array('admin-ajax.php', 'async-upload.php'))) {
        return;
    }
    global $debug;
    foreach ($this->jobs as $id => $job) {
        $debug->runtime_checkpoint(sprintf('[Theme] Shutdown - Running "%s"...', $id));
        call_user_func_array($job['callback'], $job['args']);
    }
    $this->jobs = array();
}