tribe_get_option method not working correctly, event comments are not showing

Home Forums Calendar Products Events Calendar PRO tribe_get_option method not working correctly, event comments are not showing

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #79274
    John
    Participant

    The method tribe_get_option is returning a boolean value. The method definitions take a default value to return if input value option is not found.

    So in default single-event template where conditional check for comments display:

    get_option is returning false, not even ‘no’. I have set to show comments in event options so bug is two fold in that it does not return the correct options and also it does not return the default value in method.

    #79572
    Barry
    Member

    Hi John.

    It looks like you might have shared some code to help illustrate the problem, which is great … unfortunately the forum currently does a poor job of handling any code that’s been added to replies.

    If you did indeed include a short snippet can I ask you to post again but share it via Pastebin, Gist or a similar service?

    Thanks!

    #79694
    John
    Participant

    Hi Barry,

    I pasted a little bit of code but all it was showing was the method and its use in single-event template file. It is how the product ships nothing custom, line 82 I think, conditional statement to show comments:

    tribe_get_option( ‘showComments’,’no’ ) == ‘yes’

    As said this method is returning a boolean value, but should return input string param if option not found, as documentation states. Also I have set to show comments so I am obviously hoping it returns ‘yes’! Could be 2 separate problems, I don’t know if they are related.

    #79979
    Barry
    Member

    Thanks John: a bug in the template, certainly – that particular setting is stored as a boolean value and if you have enabled the Show Comments setting it ought to return a boolean value of true. The circumstances in which it might return ‘no’ are very limited indeed and we’ll certainly correct this.

    In the meantime, you could safely override that template (following the instructions in our Themer’s Guide) and change that particular line to:

    <?php if( get_post_type() == TribeEvents::POSTTYPE && tribe_get_option( 'showComments', false ) ) { comments_template(); } ?>

    Does that help at all? We will of course strive to get this fixed in one of our next maintenance releases.

    #82408
    Leah
    Member

    Hi there,

    I just wanted to pop in here with a quick update. Although we were not able to get a fix for this into our imminent 3.3 release, it is still on the radar for inclusion in a future build. Thanks for your patience!

    ~Leah

    #95332
    Leah
    Member

    Hi there,

    I’m happy to report that we have fixed this in our upcoming version 3.4. Keep an eye on your Plugins page for an update message! Thanks for your patience while we worked on this.

    Best,
    Leah

    #982956
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘tribe_get_option method not working correctly, event comments are not showing’ is closed to new replies.