New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error related to Logger #6175
Comments
Reproduce the problemJust add the constant Identify the root causeThe root cause is due to the prefix added by Mozart which makes the autoload search in the wrong file. Scope a solutionTo solve that issue we will have to change the } elseif ( strpos( $class, 'WP_Rocket\\Dependencies\\Monolog\\' ) === 0 ) {
$class = str_replace('WP_Rocket\\Dependencies\\Monolog\\', '', $class);
$file = $rocket_path . 'inc/Dependencies/Monolog/' . str_replace( '\\', '/', $class ) . '.php';
if ( ! file_exists( $file ) ) {
$file = $rocket_path . 'vendor/monolog/monolog/src/' . str_replace( '\\', '/', $class ) . '.php';
}
} elseif ( strpos( $class, 'WP_Rocket\\Dependencies\\Psr\\Log\\' ) === 0 ) {
$file = $rocket_path . 'inc/Dependencies/Psr/Log/' . str_replace( '\\', '/', $class ) . '.php';
$file = $rocket_path . 'inc/Dependencies/Psr/Log/' . str_replace( '\\', '/', $class ) . '.php';
if ( ! file_exists( $file ) ) {
$file = $rocket_path . 'vendor/psr/log/' . str_replace( '\\', '/', $class ) . '.php';
}
} else { Then we will have to update public function on_update( $new_version, $old_version ) {
if ( version_compare( $old_version, '3.12', '>=' ) ) {
return;
}
rocket_generate_advanced_cache_file();
} Estimate the effortEffort |
@CrochetFeve0251 plz make sure that we regenerate advanced-cache.php file upon update. Also do we need to do the same added str_replace to the psr/log package? |
@engahmeds3ed true I gonna add the logic to regenarate the Concerning the |
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
When enabling debug mode, fatal error is triggered:
When tracing this part of advanced cache the following values are found:
The path is not correct.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No fatal errors happening
Additional context
https://wp-media.slack.com/archives/CUT7FLHF1/p1695028743176139
Acceptance Criteria (for WP Media team use only)
The text was updated successfully, but these errors were encountered: