• Resolved Jeff Cohan

    (@jdcohan)


    I’m using version 0.58.1 on a site for which I’m capturing errors and notices in a debug log.

    Two notices keep showing up:

    PHP Notice: Undefined index: no_post_titles in /home1/aflcioor/public_html/wp-content/plugins/list-category-posts/include/lcp-catlistdisplayer.php on line 234

    PHP Notice: Trying to get property of non-object in /home1/aflcioor/public_html/wp-content/plugins/list-category-posts/include/lcp-catlistdisplayer.php on line 227

    I realize this is a minor issue. But I thought you might be able to fix these with a simple solution. (Then, the task of finding the errors in MY code would be a little easier to find!)

    Thanks.
    Jeff Cohan

    https://www.ads-software.com/plugins/list-category-posts/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Fernando Briano

    (@fernandobt)

    Thanks for reporting this. I fixed the warning on line 234, but I haven’t been able to reproduce the one on 227. Can you provide any more details on how you’re using the plugin please? (template, shortcode, etc).

    Thanks!

    Hi, I have noticed a bug (error) in the code after upgrade to latest version 0.58.1. File ‘lcp-catlistdisplayer.php’, line 297, text “$this->stuffFunction” – missing $.

    These are my shortcodes:
    [catlist name=uradna-tabula orderby=date order=desc numberposts=5 date=yes author=no content=yes author_tag=”span” author_class=”postauthor” catlink_tag=”span” catlink_class=”postlink” date_tag=”span” date_class=”postdate” excerpt_tag=”p” excerpt_class=”postexcerpt” title_tag=”span” title_class=”posttitle” instance=1]

    [catlist name=uradna-tabula orderby=date order=desc numberposts=5 offset=5 date=yes date_tag=”span” date_class=”postdate” instance=2]

    After adding the ‘$’ everything works as expected.

    I’ve experienced the same bug as @mirojanosik and can confirm that the solution works.

    Thread Starter Jeff Cohan

    (@jdcohan)

    @fernandobt

    We’re using the plugin widget and shortcode.

    I’m thinking that a simple solution (keep in mind that I’m interested only in avoiding the PHP Notices in my debug.log file) might be to add a couple of “if” tests to the if statement on line 227.

    For example, would it work to change this:

    if ( $post->ID == $single->ID ):

    to this:

    if ( is_object($post->ID) && is_object($single->ID) && $post->ID == $single->ID ):

    ?

    Plugin Author Fernando Briano

    (@fernandobt)

    I’ll have a release out later today that fixes this and other issues.

    Thanks for your patience and contributions!
    Cheers,

    Thread Starter Jeff Cohan

    (@jdcohan)

    Excellent! Thanks so much.

    Plugin Author Fernando Briano

    (@fernandobt)

    These issues should be fixed in version 0.59. Please update and let me know if it works for you. Thanks!

    Thread Starter Jeff Cohan

    (@jdcohan)

    The 0.59 update appears to have eliminated the PHP Notice for what used to be line 227 in 0.58.1 (now line 226).

    However, I’m still getting a PHP Notice for line 233 (was line 234 in 0.58.1):

    [09-Apr-2015 22:28:13 UTC] PHP Notice: Undefined index: no_post_titles in /home1/[account_name]/public_html/wp-content/plugins/list-category-posts/include/lcp-catlistdisplayer.php on line 233

    Would it help to change this on line 233:

    if ( $this->params['no_post_titles'] != 'yes' ):

    to this:

    if ( isset($this->params['no_post_titles']) && $this->params['no_post_titles'] != 'yes' ):

    ?

    Thread Starter Jeff Cohan

    (@jdcohan)

    Now I’m also seeeing a whole slew of these errors again, in version 0.59:

    [09-Apr-2015 23:18:24 UTC] PHP Notice: Trying to get property of non-object in /home1/[account_name]/public_html/wp-content/plugins/list-category-posts/include/lcp-catlistdisplayer.php on line 226

    Plugin Author Fernando Briano

    (@fernandobt)

    Just released version 0.59.1 with more fixes. Let me know how it goes. Thanks!

    I’ve updated to 0.59.1, and there are no problems so far. Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘PHP Notices (minor issue)’ is closed to new replies.