• Resolved Miles

    (@mpfefferle)


    I get a server error when updating/publishing posts, but only when I have ACFE activated. I used ACFE to add taxonomies to posts when I built this site a few years ago. WP core, themes, and plugins are all updated, still getting the same issue. Error doesn’t occur when updating pages, but I’m not using ACFE on those. Any ideas? I can shoot you a login.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    Well, it’s hard to tell without any error message. It could be a compatibility issue with a third-party plugin too. I would recommend to enable the WP Debug mode (see documentation), it will help you to identify the cause of the issue.

    To do so, you can add the following code in your wp-config.php file, right before the comment: “That’s all, stop editing! Happy publishing”:

    define('WP_DEBUG', true);          // enable debug
    define('WP_DEBUG_LOG', true); // enable error logs
    define('WP_DEBUG_DISPLAY', false); // don't show errors on screen

    /* That's all, stop editing! Happy publishing. */

    This will log server errors in the file: /wp-content/debug.log.

    Once the debug mode code has been added, try to trigger the error again, and open this file. You should see some error message. Please share it here.

    You can read more about how to debug WordPress and ACF on our guide here.

    Let me know if you found something!

    Thanks!

    Regards.

    Thread Starter Miles

    (@mpfefferle)

    Thanks for the follow-up. I’m not getting any errors logged with debug turned on.

    Edit: Nevermind. Will followup shortly.

    • This reply was modified 11 months ago by Miles.
    Thread Starter Miles

    (@mpfefferle)

    This was the last error thrown when I triggered the server error:

    [18-Feb-2025 19:04:45 UTC] PHP Fatal error:  Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, function "update_attachment_publish_author" not found or invalid function name in /home/wp_kcqqti/foundationsofhealth.org/wp-includes/taxonomy.php:3567
    Stack trace:
    #0 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/taxonomy.php(3550): wp_update_term_count_now(Array, Object(WP_Taxonomy))
    #1 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/post.php(8082): wp_update_term_count(Array, 'publication_aut...')
    #2 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/class-wp-hook.php(324): _update_term_count_on_transition_post_status('publish', 'publish', Object(WP_Post))
    #3 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #4 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #5 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/post.php(5690): do_action('transition_post...', 'publish', 'publish', Object(WP_Post))
    #6 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/post.php(4950): wp_transition_post_status('publish', 'publish', Object(WP_Post))
    #7 /home/wp_kcqqti/foundationsofhealth.org/wp-includes/post.php(5162): wp_insert_post(Array, false, true)
    #8 /home/wp_kcqqti/foundationsofhealth.org/wp-admin/includes/post.php(453): wp_update_post(Array)
    #9 /home/wp_kcqqti/foundationsofhealth.org/wp-admin/post.php(227): edit_post()
    #10 {main}
    thrown in /home/wp_kcqqti/foundationsofhealth.org/wp-includes/taxonomy.php on line 3567
    [18-Feb-2025 19:04:46 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>Avada</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/wp_kcqqti/foundationsofhealth.org/wp-includes/functions.php on line 6114
    [18-Feb-2025 19:04:47 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>Avada</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/wp_kcqqti/foundationsofhealth.org/wp-includes/functions.php on line 6114
    [18-Feb-2025 19:04:48 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>Avada</code> domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/wp_kcqqti/foundationsofhealth.org/wp-includes/functions.php on line 6114
    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    The error message says your Taxonomy try to execute the function update_attachment_publish_author() when a post is updated, but that function doesn’t exist (neither in WordPress or ACF source code). This suggests you have some custom configuration in your Taxonomy which point to this invalid function.

    Here is the WordPress source code that trigger the error (from /wp-includes/taxonomy.php:3567):

    if ( ! empty( $taxonomy->update_count_callback ) ) {
    call_user_func( $taxonomy->update_count_callback, $terms, $taxonomy );
    }

    If you registered your taxonomy with ACF Extended, I would recommend to head over the “Tools > Taxonomies” admin menu, and check the “Update count callback” setting on each taxonomy.

    By default, it should be empty. You’ll find more information about the update_count_callback setting on the register_taxonomy() documentation here.

    I would also recommend to check your settings in your Taxonomies, see if you have anything unusual.

    Thanks!

    Regards.

    Thread Starter Miles

    (@mpfefferle)

    Thank you!!! That points me in the right direction. Not your fault after all 😀

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I’m glad to hear it now works as expected!

    If you enjoy this plugin and its support, feel free to submit a review. It always helps and it’s much appreaciated 🙂

    Have a nice day!

    Regards.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Server error when updating post’ is closed to new replies.