mattwatsoncodes / link-picker-for-cmb2

Link Picker control designed to work with CMB2
https://wordpress.org/plugins/link-picker-for-cmb2/
3 stars 8 forks source link

Upload Media Error #5

Open carasmo opened 6 years ago

carasmo commented 6 years ago

With this plugin active, when I click add new media, I get:

Notice: Trying to get property of non-object in /app/public/wp-includes/media.php on line 3467 Notice: Trying to get property of non-object in /app/public/wp-includes/media.php on line 3468 Notice: Trying to get property of non-object in /app/public/wp-includes/media.php on line 3471 Notice: Trying to get property of non-object in /app/public/wp-includes/media.php on line 3471 Notice: Trying to get property of non-object in /app/public/wp-includes/media.php on line 3472

Local dev. 4.9. No other plugins active. Genesis Sample theme.

Any ideas how to correct this?

carasmo commented 6 years ago

This removes the error and the plugin works.

Change run() in class-controller-main.php

    /**
     * Do Work
     */
    public function run() {
        load_plugin_textdomain( 'link-picker-for-cmb2', false, MKDO_LPFC_ROOT . '\languages' );

        global $pagenow;
        if ( $pagenow != 'media-new.php' ) {
            $this->controller_assets->run();
        }

        $this->render_meta_box->run();
    }
mattwatsoncodes commented 6 years ago

Thank you @carasmo, we will get this patched in the next release.

m9n commented 6 years ago

Should be resolved with https://github.com/mwtsn/link-picker-for-cmb2/pull/9

mattwatsoncodes commented 6 years ago

Resolved now, thanks @m9n, I'll leave this open until it is pushed to the WP repo.