Home › Forums › Bug Reports › ACF Pro 5.7.11 + Simple History 2.29.1 not working together
Hi guys,
Looks like since upgrading to 5.7.11 I’m getting an issue if I have the Simple History plugin active.
I’ve also seen this issue recently logged on simple history here 11 hours ago:
https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-_acf_get_field_by_id/#post-11208158
Specifically the steps to replicate for me are to update a date/time field on a page and try and publish. This results in a 500 error but the page actually saves the changes.
The logs show this error:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function _acf_get_field_by_id() in /httpdocs/wp-content/plugins/simple-history/loggers/Plugin_ACF.php:374\nStack trace:\n#0 /httpdocs/wp-content/plugins/simple-history/loggers/Plugin_ACF.php(271): Plugin_ACF->add_acf_context(Array, 'changed', Array, Array, Array, Array)\n#1 /httpdocs/wp-includes/class-wp-hook.php(286): Plugin_ACF->on_acf_save_post(174)\n#2 /httpdocs/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#3 /httpdocs/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#4 /httpdocs/wp-content/plugins/advanced-custom-fields-pro/includes/acf-form-functions.php(136): do_action('acf/save_post', 174)\n#5 /httpdocs/wp-content/plu...\n', referer: https://websiteurl.com.au/wp-admin/post.php?post=174&action=edit
Same with ACF PRO 5.7.12
Call to undefined function _acf_get_field_by_id() in /plugins/simple-history/loggers/Plugin_ACF.php
disabling the logger for now.
Having a similar issue here as well.
Error thrown
Call to undefined function _acf_get_field_by_id()
I had a similar issue with another plugin. It seems there have been some changes in ACF that will require attention by the developer of the other plugin and you’ll probably want to contact them about it. Most of the changes causing this issue are do to the removal or renaming of some internal functions that other developers may have been using.
On /wp-content/plugins/simple-history/loggers/Plugin_ACF.php line 374 you have the following:
$parent_field = _acf_get_field_by_id( $parent_field['parent'] );
It seems that function no longer exists in ACF.
So, I did a little digging into this and it seems that in version 5.7.11/12 ACF decided to deprecate the function called “_acf_get_field_by_id”. However, in the /advanced-custom-fields-pro/includes/acf-deprecated-functions.php line 57 the function is called “_acf_get_fields_by_id” (Note “fields” in plural) and that seems to be breaking resources that are still using the deprecated _acf_get_field_by_id, due to a typo/misspelling of the function?
ACF, any input on this?
Just for the record, I renamed the deprecated function to “_acf_get_field_by_id” back to singular “field” and Simple History is now working without throwing the error.
Please contact the regular support on this https://www.advancedcustomfields.com/contact/
I have already done and I have been corresponding with Kenny.
For a fix with the coexistence with Simple History please refer to https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-_acf_get_field_by_id/#post-11222978.
However, I still don’t understand why ACF changed the function name when deprecating it.
The topic ‘ACF Pro 5.7.11 + Simple History 2.29.1 not working together’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.