Skip Navigation

[Resolved] 'Warning: Cannot modify header information' with CPT since WP 5.3 update

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 3 voices.

Last updated by pabloV-3 4 years, 12 months ago.

Assisted by: Waqar.

Author
Posts
#1401085
Screenshot_2019-12-05 Edit Post Type ‹ COPAKE AUCTION INC — WordPress.png
Screenshot_2019-12-05 Edit Content Template ‹ COPAKE AUCTION INC — WordPress.png

CPT 'Auctions' (page template)
hidden link
has since WP 5.3 update experienced Warning errors when editing/updating this CPT/Content Template :

Warning: parse_url() expects parameter 1 to be string, array given in /home/copakeauction/www/www/staging/wp-includes/media.php on line 4246

Warning: strpos() expects parameter 1 to be string, array given in /home/copakeauction/www/www/staging/wp-includes/media.php on line 4253

Warning: Cannot modify header information - headers already sent by (output started at /home/copakeauction/www/www/staging/wp-includes/media.php:4246) in /home/copakeauction/www/www/staging/wp-includes/pluggable.php on line 1265

Warning: Cannot modify header information - headers already sent by (output started at /home/copakeauction/www/www/staging/wp-includes/media.php:4246) in /home/copakeauction/www/www/staging/wp-includes/pluggable.php on line 1268

Here are the lines from the plugins indicated in warning:

/home/copakeauction/www/www/staging/wp-includes/pluggable.php

lines 1252-1272

/**
* Filters the X-Redirect-By header.
*
* Allows applications to identify themselves when they're doing a redirect.
*
* @since 5.1.0
*
* @param string $x_redirect_by The application doing the redirect.
* @param int $status Status code to use.
* @param string $location The path to redirect to.
*/
$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );
if ( is_string( $x_redirect_by ) ) {
header( "X-Redirect-By: $x_redirect_by" );
}

header( "Location: $location", true, $status );

return true;
}
endif;

/home/copakeauction/www/www/staging/wp-includes/media.php

lines 1241-1253

/**
* To make sure the ID matches our image src, we will check to see if any sizes in our attachment
* meta match our $image_src. If no matches are found we don't return a srcset to avoid serving
* an incorrect image. See #35045.
*/
$src_matched = false;

/*
* Loop through available images. Only use images that are resized
* versions of the same edit.
*/
foreach ( $image_sizes as $image ) {
$is_src = false;

-------------------------

** NOTE *** This is a simple Content Template setup and worked perfectly until recent update. All other CPT, templates/views are working fine.
Let me know if you need WP login access to the staging server. I've waited patiently for 2-3 weeks for resolve w/an update for toolset without change.

#1401333

Hi James,

Thank you for contacting us and I'd be happy to assist.

This error is already reported for post types with repeating image field:
https://toolset.com/errata/repeating-image-and-file-fields-produce-php-warnings-with-wordpress-5-3/

A fix for this is planned to be covered in the upcoming Types version 3.3.8 and I'll keep you updated through this ticket.
( it is expected to be out very soon )

regards,
Waqar

#1405123

Hi James,

I'd like to share that a fix for this issue has been included in the latest release of Toolset Types.

You're welcome to update and let us know in case the issue still persists.

regards,
Waqar

#1935325
Screen Shot 2021-02-05 at 7.25.21 AM.png

I installed the latest version of Toolset Types 3.4.7 and the issue is still present in my client's website. See screenshot attached.