[wp-trac] [WordPress Trac] #59956: author feed having an issue on latest WP6.4 version
WordPress Trac
noreply at wordpress.org
Thu Nov 30 16:47:44 UTC 2023
#59956: author feed having an issue on latest WP6.4 version
-------------------------------+------------------------------
Reporter: janareddy | Owner: (none)
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Feeds | Version: 6.4
Severity: major | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by hellofromTonya):
* keywords: => reporter-feedback
Comment:
Hello @janareddy,
Welcome back to WordPress Core's Trac :) Thank you for opening this ticket
and referencing [https://wordpress.org/support/topic/having-an-issue-on-
author-feed-on-wp-6-4/ the discussion in the support ticket].
>as per little debug it seems in feed.php on line number 720 max() command
having issue , its expecting array but date string is passing.
Hmm, I'm not seeing how a string is being passed to `max()` in the
`get_feed_build_date()` function as `$modified_times` will always be an
array. But that said, the error you noted indicates `$modified_times` is
an empty array.
Passing an empty array to `max()` is a Warning on < PHP 8 or a
`ValueError` on >= PHP 8. See it in action https://3v4l.org/AaEOD and more
information is available [https://www.php.net/manual/en/function.max.php
in the PHP manual].
Looking at the code, this area of the code runs when there are posts to
process. `$modified_times` will contain an array of the posts'
`'post_modified_gmt'` values. For `$modified_times` to be an empty array,
the data in `$wp_posts->posts` would either be empty or not have
`'post_modified_gmt'` field / value.
I'm not seeing how this was introduced in 6.4 specifically. Wondering if
the issue was existed on your site(s) previously, maybe as a PHP Warning
in your server logs.
To help contributors investigate and reproduce the issue, need some more
information please:
>if you see the live feed page
https://spearswms.com/author/janechurch/feed/ this is running on WP6.1 and
no issue. when we update to WP6.4 on Dev branch.
* Was the site previously on WP 6.1 also running on PHP 8? Or was the
upgrade to WP 6.4 along with upgrading to PHP 8?
* On the sites not running WP 6.4, are there PHP Warnings for `max()` in
the server logs?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59956#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list