-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unable to disable plugin from theme #27
Comments
Hi @fiskhandlarn, from some preliminary tests it seems that after adding your filter the Bugsnag exception and error handlers are no-longer being set. Are you saying this is not what you are seeing? |
@Cawllec They are not disabled for me in version 1.3.0. If I rewrite the plugin so that the filter is being run when set in functions.php I still get the warnings in |
This is with 1.3.0 as well. I'll have a further look into what you're reporting and get back to you. |
@Cawllec Strange. The only occurrence of
Which is called directly when the plugin is loaded, which happens before Did you put your |
I did. |
@Cawllec When/where is the For me it looks like this: Line 314 (run when the plugin is included): Line 33 (inside Line 70 (inside Line 88 (inside |
So my path is going: As for the filter, at the bottom of
|
@Cawllec Well yes, bugsnag's error handling is enabled with your code. But not because you're adding the filter in your
As you can see, What I'm asking for is the abilitiy to disable bugsnag's error handlers (as specified in the subject of this issue). What happens when you instead use this code in your
(Please notice the |
Sorry, I meant |
@Cawllec Ah, alright :) But I cannot for the life of me understand why your filter works and mine don't. The only way I can think of is if your And maybe you can dump |
So with a
and a
(with newlines added by me). So it seems that your Bugsnag.php may be being loaded prematurely? What wordpress version are you running? |
@Cawllec It was 4.9.4, but I've updated to 4.9.5 now (with the same behaviour). I haven't seen that loading order before. https://wordpress.stackexchange.com/questions/26537/between-functions-php-widgets-and-plugins-which-is-loaded-first/26622#26622 also states that plugins are loaded before the theme. Are you running "vanilla" WordPress? |
I'm using the Wordpress 4.9.4 docker image , running on PHP 7.2. It should be as unmodified as possible, I'll check and see if the image has any differences. |
@Cawllec Please do :) If your WordPress files look like this: ... the theme should be loaded after all plugins. Just to rule out any confusion, you are using the filter in the |
I absolutely was not. You're quite right about loading order - I misread your point very early on, sorry this has been a bit more roundabout than it should have been.
|
@Cawllec No worries, I'm only happy we understand each other now. :) A solution for actually make the filter usable is to call But, I have no idea how to fix the plugin from causing these warnings when the error handlers once are disabled:
|
@Cawllec @GrahamCampbell Any news on this? :) |
Hi @fiskhandlarn, there's some higher priority work going on at the moment, but this, and more of a general update to this notifier, are in the pipeline, and I will update you when I know more. |
Hi @fiskhandlarn, it's been a while but I've had a chance to look into this issue again. The |
I'm going to close this issue for now, but if the issue persists please get in touch. |
@Cawllec The |
The ticket to fix this is being prioritised, but will likely be included with other notifier improvements. The solution as it stands is to use As work on the notifier improvements are implemented this thread will be brought back in. |
@Cawllec Alright, I will use FYI: if the "bugsnag_filterfields" option isn't set in the database |
When developing locally I would like to use PHP's native error handler instead of Bugsnag's, but still have the same code base/database for my local and live server (and not being forced to manually deactivate the plugin for different servers).
ATM it's impossible to override with the
bugsnag_set_error_and_exception_handlers
filter from within functions.php (since it's applied directly when the plugin loads (which is before the theme)).Expected behavior
should disable this plugin's custom error handlers.
Observed behavior
Nothing is happening with the above filter present in my theme's
functions.php
.Steps to reproduce
See above.
Version
1.3.0
Additional information
If I rewrite the Bugsnag_Wordpress constructor so that activateBugsnag() is called on
init
:and change activateBugsnag() to public, the error handlers are indeed disabled, but I get this warning:
Warning: strpos(): Empty needle in plugins\bugsnag\bugsnag-php\Error.php on line 386
The same warning appears without the modified class if I run
restore_error_handler();
in myfunctions.php
.The text was updated successfully, but these errors were encountered: