Fatal PHP Error after updating to version 4.4.32

Home Forums Calendar Products Events Calendar PRO Fatal PHP Error after updating to version 4.4.32

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1621857
    Sean
    Participant

    Hi,

    I may have come across a bug in version 4.4.32 of TEC PRO. After updating, I found that the event information was no longer appearing on our single event pages. Upon viewing our system logs, I found the following:

    PHP Fatal error: Uncaught Error: Call to undefined function tribe_get_custom_field()

    After reverting TEC PRO to version 4.4.31, the event info is not showing up correctly. So it appears the source of the problem may be in that update.

    #1622310
    Sean
    Participant

    This reply is private.

    #1622423
    Patti
    Participant

    This reply is private.

    #1622434
    Brendan
    Keymaster

    This reply is private.

    #1622469
    Sean
    Participant

    Thanks Brandon. I unfortunately can’t see Patti’s link because it was a private post.

    I understand we need to replace the old function tribe_get_custom_field( 'Our Custom Field Label' ) with the new function. However, I’m unclear of the exact code. If we need to replace it with tribe_get_custom_fields( $id) what do we need to replace the ( $id) with and where we can find that value? Sorry for not understanding your initial reply, we’re still getting accustomed to customizing php!

    Here’s the original function/code:

    <div class = "right-float-box" >
        <div class = "right-float-box-wrapper">
             
            <a class="tribe-events-event-url blue-button" href="<?php echo tribe_get_event_meta( get_the_ID(), '_EventURL', true ); ?>" target="_blank">Event Website</a>
             
            <?php if ( tribe_get_custom_field( 'Online Registration' ) ) : ?>
                <a class="tribe-events-regurl green-button" href="<?php echo esc_url( tribe_get_custom_field( 'Online Registration' ) ); ?>" target="_blank" >Register Online </a>
            <?php endif; ?>
            <?php if ( tribe_get_custom_field( 'Paper Application' ) ) : ?>
                <a class="white-button" href="<?php echo esc_url( tribe_get_custom_field( 'Paper Application' ) ); ?>" target="_blank" >Mail In Application</a>
            <?php endif; ?>
        </div>
    </div>

    Thank you and have a great weekend!

    #1622470
    Patti
    Participant

    Not sure why you can’t see my private post? see below.

    I had the same problem. If you’re using tribe_get_custom_field() to pull custom fields to your pages, that not longer works. See https://pastebin.com/Cuqbif9f for fix/replacement.

    #1622819
    Sean
    Participant

    Thanks Patti! Is my understanding correct that (if we use the first replacement option) we should replace tribe_get_custom_field with TribeEventsCustomMeta::get_custom_field_by_label in our template override files?

    #1622953
    Patti
    Participant

    Yes, like that. You could simplify it even more by creating a var for each custom field.

    
    // Put above the content
    $fields = tribe_get_custom_fields();
    
    // Create your vars
    $onlinereg = $fields['Online Registration'];
    $paperapp = $fields['Paper Application'];
    #1623037
    Sean
    Participant

    Great, thank you so much for your help!

    #1623471
    Brendan
    Keymaster

    Thanks Patti!

    Let us know if you need anything else Karly.

    Brendan

    #1640163
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Fatal PHP Error after updating to version 4.4.32’ is closed to new replies.