Closed LordSimal closed 7 months ago
That is very interesting.
Can you share a bit more info. PHP version, WordPress version, if you have a networks site, what other WP_SENTRY_*
things do you have defined in your wp-config.php
, any custom hooks or custom config for the Sentry plugin etc.?
I have put this on top of my wp-config.php
:
define( 'WP_SENTRY_DSN', '...' );
require_once __DIR__ . '/wp-content/plugins/wp-sentry/wp-sentry.php';
But cannot see the error you are seeing.
PHP 8.1 Wordpress 6.3.2
wp-config.php
define( 'WP_SENTRY_PHP_DSN', '--my-dsn--' );
define( 'WP_SENTRY_ENV', 'production' );
also we have 1 additional filter inside the themes functions.php
if( class_exists('\Sentry\Options') ) {
add_filter( 'wp_sentry_options', function ( \Sentry\Options $options ) {
$options->setBeforeSendCallback( function ( \Sentry\Event $event ) {
$exceptions = $event->getExceptions();
if( isset( $exceptions[0] ) &&
method_exists( $exceptions[0], 'getValue' ) &&
$exceptions[0]->getValue() == 'Warning: preg_match(): Compilation failed: quantifier does not follow a repeatable item at offset 1' ) {
return null;
}
return $event;
});
});
}
and as you can see i forgot to return the $options
🙈
so this fixed the issue for me:
if( class_exists('\Sentry\Options') ) {
add_filter( 'wp_sentry_options', function ( \Sentry\Options $options ) {
$options->setBeforeSendCallback( function ( \Sentry\Event $event ) {
$exceptions = $event->getExceptions();
if( isset( $exceptions[0] ) &&
method_exists( $exceptions[0], 'getValue' ) &&
$exceptions[0]->getValue() == 'Warning: preg_match(): Compilation failed: quantifier does not follow a repeatable item at offset 1' ) {
return null;
}
return $event;
});
return $options;
});
}
That makes more sense 😅 Couldn't figure out how that value would ever be null
but that explains it, thanks for the quick update!
I got this error after updating the Sentry Plugin from 7.1.0 -> 7.2.1 and got that error:
I solved it via commenting out the
inside the wp-config.php to catch errors inside plugins or while bootstrapping.