• Resolved yarsky

    (@yarsky)


    REST POST cause:
    “Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class PodsRESTHandlers does not have a method \”update_handler\” in /home/sites/public_html/wp-includes/rest-api/endpoints/class-wp-rest-controller.php:469\nStack trace:\n#0 /home/sites/public_html/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php(600): WP_REST_Controller->update_additional_fields_for_object()\n#1 /home/sites/public_html/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Terms_Controller->create_item()\n#2 /home/sites/public_html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()\n#3 /home/sites/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()\n#4 /home/sites/public_html/wp-includes/rest-api.php(459): WP_REST_Server->serve_request()\n#5 /home/sites/public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded()\n#6 /home/sites/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#7 /home/sites/public_html/wp-includes/plugin.php(565): WP_Hook->do_action()\n#8 /home/sites/public_html/wp-includes/class-wp.php(418): do_action_ref_array()\n#9 /home/sites/public_html/wp-includes/class-wp.php(818): WP->parse_request()\n#10 /home/sites/public_html/wp-includes/functions.php(1342): WP->main()\n#11 /home/sites/public_html/wp-blog-header.php(16): wp()\n#12 /home/sites/public_html/index.php(17): require(‘…’)\n#13 {main}\n thrown”,

    Dummy update_handler in the PodsRESTHandlers.php resolve problem

    /**
    * Dummy update handler for WordPress REST API compatibility
    *
    * @param mixed $value Value to update
    * @param object $object The object being updated
    * @param string $field_name Field name
    * @return bool
    */
    public static function update_handler( $value, $object, $field_name ) {
    // Пустой метод – реальное сохранение идет через save_handler hook
    return true;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support pdclark

    (@pdclark)

    Reported on the Pods plugin GitHub for review and development at https://github.com/pods-framework/pods/issues/7470

    Please comment there with any details on reproducing the error if possible.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    We don’t have any references to update_handler in Pods and we don’t set a update_callback when calling register_rest_field(). I’m curious if there’s some custom code running that’s referencing that.

    Unable to reproduce the issue and don’t have a solution available for you at the moment.

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

You must be logged in to reply to this topic.