• Resolved donbowman

    (@donbowman)


    /wp-json/tribe/events/v1/events
    works in 5.9.0
    in 5.9.1 it gives php errors

    
    
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP Warning:  reset(): Argument #1 ($array) must be passed by reference, value given in /app/wp-content/plugins/the-events-calendar/src/Tribe/REST/V1/Post_Repository.php on line 92"
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP Stack trace:"
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP   1. {main}() /app/index.php:0"
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP   2. require() /app/index.php:17"
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP   3. wp($query_vars = *uninitialized*) /app/wp-blog-header.php:16"
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP   4. WP->main($query_args = '') /app/wp-includes/functions.php:1291"
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP   5. WP->parse_request($extra_query_vars = '') /app/wp-includes/class-wp.php:750"
    2021/10/02 00:22:04 [error] 79#79: *8900 FastCGI sent in stderr: "...], 'x_envoy_decorator_operation' => [...], 'x_request_id' => [...], 'x_envoy_external_address' => [...], 'x_forwarded_proto' => [...], 'x_forwarded_for' => [...], 'accept' => [...], 'accept_encoding' => [...], 'user_agent' => [...], 'host' => [...], 'content_type' => [...]]; protected $body = ''; protected $route = '/tribe/events/v1/events'; protected $attributes = ['methods' => [...], 'accept_json' => FALSE, 'accept_raw' => FALSE, 'show_in_index' => TRUE, 'a...PHP message: PHP  14. Tribe__Events__REST__V1__Post_Repository->get_event_data($event_id = 781756, $context = *uninitialized*) /app/wp-content/plugins/the-events-calendar/src/Tribe/REST/V1/Endpoints/Archive_Event.php:198PHP message: PHP  15. array_map($callback = 'reset', $array = ['inline_featured_image' => [0 => '0'], '_tribe_hide_attendees_list' => [0 => '0'], '_EventOrigin' => [0 => 'events-calendar'], '_tribe_ticket_capacity' => [0 => ''], '_tribe_ticket_version' => [0 => '5.1.9.1'], '_edit_lock' => [0 => '1633098050:180017'], '_edit_last' => [0 => '180017'], 'wpp_send_notification_for_new_post' => [0 => ''], 'webpushr_segment' => [0 => 'a:1:{i:0;s:6:"255771";}'], 'webpushr_notification_title' => [0 => '{post_title}'], 'webpushr_notification_body' => [0 => '{post_excerpt}'], 'mbp_autopost_checked' => [0 => ''], '_yoast_wpseo_focuskeywords' => [0 => '[]'], '_yoast_wpseo_keywordsynonyms' => [0 => '[""]'], '_yoast_wpseo_estimated-reading-time-minutes' => [0 => '3'], 'webinar_url' => [0 => 'meet.google.com/yun-adtz-fdi'], '_mbp_gutenberg_autopost' => [0 => ''], 'pgc_sgb_lightbox_settings' => [0 => ''], 'neve_meta_sidebar' => [0 => ''], 'neve_meta_container' => [0 => ''], 'neve_meta_enable_content_width' => [0 =>...PHP message: PHP Warning:  reset(): Argument #1 ($array) must be passed by reference, value given in /app/wp-content/plugins/the-events-calendar/src/Tribe/REST/V1/Post_Repository.php on line 92PHP message: PHP Stack trace:PHP message: PHP   1. {main}() /app/index.php:0PHP message: PHP   2. require() /app/index.php:17PHP message: PHP   3. wp($query_vars = *uninitialized*) /app/wp-blog-header.php:16PHP message: PHP   4. WP->main($query_args = '') /app/wp-includes/functions.php:1291PHP message: PHP   5. WP->parse_request($extra_query_vars = '') /app/wp-includes/class-wp.php:750PHP message: PHP   6. do_action_ref_array($hook_name = 'parse_request', $args = [0 => class WP { public $public_query_vars = [...]; public $private_query_vars = [...]; public $extra_query_vars = [...]; public $query_vars = [...]; public $query_string = NULL; public $request = 'wp-json/tribe/events/v1/events'; public $matched_rule = '^wp-json/(.*)?'; public $matched_query = 'rest_route=/tribe%2Fevents%2Fv1%2Fevents'; public $did_permalink = TRUE }]) /app/wp-includes/class-wp.php:388PHP message: PHP   7. WP_Hook->do_action($args = [0 => class WP { public $public_query_vars = [...]; public $private_query_vars = [...]; public $extra_query_vars = [...]; public $query_vars = [...]; public $query_string = NULL; public $request = 'wp-json/tribe/events/v1/events'; public $matched_rule = '^wp-json/(.*)?'; public $matched_query = 'rest_route=/tribe%2Fevents%2Fv1%2Fevents'; public $did_permalink = TRUE }]) /app/wp-includes/plugin.php:518PHP message: PHP   8. WP_Hook->apply_filters($value = '', $args = [0 => class WP { public $public_query_vars = [...]; public $private_query_vars = [...]; public $extra_query_vars = [...]; public $query_vars = [...]; public $query_string = NULL; public $request = 'wp-json/tribe/events/v1/events'; public $matched_rule = '^wp-json/(.*)?'; public $matched_query = 'rest_route=/tribe%2Fevents%2Fv1%2Fevents'; public $did_permalink = TRUE }]) /app/wp-includes/class-wp-hook.php:327PHP message: PHP   9. rest_api_loaded(class WP { public $public_query_vars = [0 => 'm', 1 => 'p', 2 => 'posts', 3 => 'w', 4 => 'cat', 5 => 'withcomments', 6 => 'withoutcomments', 7 => 's', 8 => 'search', 9 => 'exact', 10 => 'sentence', 11 => 'calendar', 12 => 'page', 13 => 'paged', 14 => 'more', 15 => 'tb', 16 => 'pb', 17 => '
    [02-Oct-2021 00:22:04] WARNING: [pool www] child 292 said into stderr: "NOTICE: PHP message: PHP   6. do_action_ref_array($hook_name = 'parse_request', $args = [0 => class WP { public $public_query_vars = [...]; public $private_query_vars = [...]; public $extra_query_vars = [...]; public $query_vars = [...]; public $query_string = NULL; public $request = 'wp-json/tribe/events/v1/events'; public $matched_rule = '^wp-json/(.*)?'; public $matched_query = 'rest_route=/tribe%2Fevents%2Fv1%2Fevents'; public $did_permalink = TRUE }]) /app/wp-includes/class-wp.php:388"

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter donbowman

    (@donbowman)

    https://bugs.php.net/bug.php?id=80699

    is the underlying reason.
    array_map no longer passes by reference.
    reset() requires reference.

    e.g. REST/V1/Post_Repository.php:92

    adding:

    
            public static function _reset($arr) {
                    return reset($arr);
            }
    

    and changing to e.g.
    $meta = array_map( ‘Tribe__Events__REST__V1__Post_Repository::_reset’, get_post_custom( $event_id ));

    resolves.

    • This reply was modified 3 years, 5 months ago by donbowman.

    @donbowman

    Thank you for reaching out and bringing this to our attention!
    We made this a high-priority bug.

    Hang tight as we release a bug fix!

    Cheers,
    Geoff

    @donbowman Good news!

    The bug fix is here. Please update your plugins and let us know how it goes.

    Thanks for your patience while we worked on this!

    -James

    Thread Starter donbowman

    (@donbowman)

    great! will try.

    Thread Starter donbowman

    (@donbowman)

    yes this resolves, thanks very much.

    Plugin Support Jaime

    (@jaimemarchwinski)

    Great, glad to hear it!

    I’m going to go ahead and close this thread for now.

    Feel free to open up a new one if anything else comes up.

    Have a wonderful day!

    Thanks,?
    Jaime`

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘5.9.1 breaks wp-json interface’ is closed to new replies.