WordPress.org

Ready to get started?Download WordPress

Forums

WP Gallery Custom Links
[resolved] error notices (6 posts)

  1. thomask
    Member
    Posted 1 year ago #

    please turn wp_debug true

    Notice: Undefined variable: order in /var/www/vhosts/money.cz/httpdocs/wp-content/plugins/wp-gallery-custom-links/wp-gallery-custom-links.php on line 105

    Notice: Undefined variable: orderby in /var/www/vhosts/money.cz/httpdocs/wp-content/plugins/wp-gallery-custom-links/wp-gallery-custom-links.php on line 105

    http://wordpress.org/extend/plugins/wp-gallery-custom-links/

  2. fourlightsweb
    Member
    Plugin Author

    Posted 1 year ago #

    Removed two undefined order parameters and added an isset() around $attr['link']. The above should now be resolved in version 1.0.2. Thanks!

  3. thomask
    Member
    Posted 1 year ago #

    great, you got five stars from me ;)
    there is also one more error notice in some special cases

    Notice: Trying to get property of non-object in /var/www/vhosts/money.cz/httpdocs/wp-content/plugins/wp-gallery-custom-links/wp-gallery-custom-links.php on line 104

    (sometimes $post is not populated, so you should do something like
    75: if (!$post) return;

  4. fourlightsweb
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the rating! :D Can you give me an example of when $post is not populated so I can test that scenario? I looked at WordPress's default gallery shortcode function, and it also appears to assume $post is set, so I've been trying to think of how/when that error might occur.

  5. thomask
    Member
    Posted 1 year ago #

    actually i do not know exactly where, but it definitely is ;-) e.g. when you use relevanssi search or probably when you are using [gallery] in widget etc.

    i will test it for you if you will make this change (i have allready done - i hardcode it to your plugin)

    I know it is wrong even in core wordpress, i have allready reported this bug http://core.trac.wordpress.org/ticket/20870

    I got even quickfix for wordpress:

    add_filter( 'post_gallery', 'mc_post_gallery_fix', 1000, 2 );
    function mc_post_gallery_fix () {
    global $post;
    if (!$post) return ' ';
    }
  6. fourlightsweb
    Member
    Plugin Author

    Posted 1 year ago #

    I added:

    if ( ! $post ) return ' ';

    in 1.0.3, let me know if that works. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic