Make WordPress Core

Opened 13 months ago

Last modified 12 months ago

#59956 assigned defect (bug)

author feed having an issue on latest WP6.4 version

Reported by: janareddy's profile janareddy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 6.4
Component: Feeds Keywords: reporter-feedback
Focuses: Cc:

Description (last modified by sabernhardt)

Team,

The author feed Ex:(www.google.com/author/author-name/feed/) is having issue on WP6.4.

currently we are using PHP8.1 and WP6.1 on this combination author feed is working as expected.

Recently we are trying to upgrade to WP6.4 , PHP version will be same(PHP8.1) this combination is having issue on author feed.

Below is the error we are getting
Uncaught ValueError: max(): Argument #1 ($value) must contain at least one element

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.

please go through this link for more details https://wordpress.org/support/topic/having-an-issue-on-author-feed-on-wp-6-4/

as suggested i am raising a ticket here, could you please check this.

Change History (3)

#1 @sabernhardt
13 months ago

  • Component changed from WordPress.org Site to Feeds
  • Description modified (diff)

#2 @hellofromTonya
12 months ago

  • Keywords reporter-feedback added

Hello @janareddy,

Welcome back to WordPress Core's Trac :) Thank you for opening this ticket and referencing 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 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?

#3 @janareddy
12 months ago

The live site (https://spearswms.com/author/janechurch/feed/ ) running on PHP 8.1 and WP 6.1

the branch we have tried is PHP 8.1 and WP6.4 (on this case we are getting error).

Note: See TracTickets for help on using tickets.