You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context
Following #6694 there is still a regression on develop for picture and img-srcset LCP/ATF.
The issue is that they can be saved in DB without the src attribute, creating a fatal:
[05-Jun-2024 17:12:05 UTC] PHP Warning: Undefined property: stdClass::$src in /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Controller.php on line 155
[05-Jun-2024 17:12:05 UTC] PHP Fatal error: Uncaught TypeError: preg_quote(): Argument #1 ($str) must be of type string, null given in /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Controller.php:155
Stack trace:
#0 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Controller.php(155): preg_quote()
#1 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Controller.php(119): WP_Rocket\Engine\Media\AboveTheFold\Frontend\Controller->set_fetchpriority()
#2 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Controller.php(86): WP_Rocket\Engine\Media\AboveTheFold\Frontend\Controller->preload_lcp()
#3 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Subscriber.php(46): WP_Rocket\Engine\Media\AboveTheFold\Frontend\Controller->lcp()
#4 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/class-wp-hook.php(324): WP_Rocket\Engine\Media\AboveTheFold\Frontend\Subscriber->lcp()
#5 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#6 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Optimization/Buffer/Optimization.php(100): apply_filters()
#7 [internal function]: WP_Rocket\Engine\Optimization\Buffer\Optimization->maybe_process_buffer()
#8 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/functions.php(5373): ob_end_flush()
#9 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/class-wp-hook.php(324): wp_ob_end_flush_all()
#10 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#11 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/plugin.php(517): WP_Hook->do_action()
#12 /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-includes/load.php(1260): do_action()
#13 [internal function]: shutdown_action_hook()
#14 {main}
thrown in /var/www/html/mathieu.e2e.rocketlabsqa.ovh/wp-content/plugins/wp-rocket/inc/Engine/Media/AboveTheFold/Frontend/Controller.php on line 155
{"type":"picture","src":"","sources":[{"srcset":"http:\/\/mathieu.e2e.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/lcp\/testavif.avif","media":"(min-width: 700px)"},{"srcset":"http:\/\/mathieu.e2e.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/lcp\/testPng.png","media":"(min-width: 450px)"}]}
On develop, the src attribute is missing.
Expected behavior
src attribute must always be set for an LCP/ATF object in the DB.
No Fatal related to missing $lcp->src must occur.
Context
Following #6694 there is still a regression on develop for picture and img-srcset LCP/ATF.
The issue is that they can be saved in DB without the src attribute, creating a fatal:
This is reproducible on this template: http://mathieu.e2e.rocketlabsqa.ovh/lcp_no_dimensions_picture
On 3.16, we have in the DB for Desktop LCP on this page:
{"type":"picture","src":"","sources":[{"srcset":"http:\/\/mathieu.e2e.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/lcp\/testavif.avif","media":"(min-width: 700px)"},{"srcset":"http:\/\/mathieu.e2e.rocketlabsqa.ovh\/wp-content\/rocket-test-data\/images\/lcp\/testPng.png","media":"(min-width: 450px)"}]}
On develop, the src attribute is missing.
Expected behavior
src attribute must always be set for an LCP/ATF object in the DB.
No Fatal related to missing $lcp->src must occur.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: