Home › Forums › Calendar Products › Events Calendar PRO › Fatal PHP Error after updating to version 4.4.32
- This topic has 9 replies, 3 voices, and was last updated 7 years, 6 months ago by
Brendan.
-
AuthorPosts
-
September 14, 2018 at 7:18 am #1621857
Sean
ParticipantHi,
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.
September 14, 2018 at 12:30 pm #1622310Sean
ParticipantThis reply is private.
September 14, 2018 at 3:27 pm #1622423Patti
ParticipantThis reply is private.
September 14, 2018 at 3:42 pm #1622434Brendan
KeymasterThis reply is private.
September 14, 2018 at 6:23 pm #1622469Sean
ParticipantThanks 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 withtribe_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!
September 14, 2018 at 6:29 pm #1622470Patti
ParticipantNot 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.
September 15, 2018 at 6:04 pm #1622819Sean
ParticipantThanks Patti! Is my understanding correct that (if we use the first replacement option) we should replace
tribe_get_custom_fieldwithTribeEventsCustomMeta::get_custom_field_by_labelin our template override files?September 16, 2018 at 5:53 am #1622953Patti
ParticipantYes, 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'];September 16, 2018 at 2:37 pm #1623037Sean
ParticipantGreat, thank you so much for your help!
September 17, 2018 at 9:25 am #1623471Brendan
KeymasterThanks Patti!
Let us know if you need anything else Karly.
Brendan
October 9, 2018 at 9:35 am #1640163Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Fatal PHP Error after updating to version 4.4.32’ is closed to new replies.
