When enabling the webprofiler, I get a 404 at the bottom of my pages. Upon looking in the php error log, I see that something is trying to call a ::destruct method.

This is with drupal 8.3.1

This may not be the correct solution, but adding this code to the bottom of "devel/webprofiler/src/State/StateWrapper.php" fixed my issue and the bar started working (mostly, it still doesn't always load and doesn't work for anon users when giving that perm, but I see other bugs have been logged for that).

diff --git a/docroot/modules/contrib/devel/webprofiler/src/State/StateWrapper.php b/docroot/modules/contrib/devel/webprofiler/src/State/StateWrapper.php
index f42e66f..f2aa45d 100644
--- a/docroot/modules/contrib/devel/webprofiler/src/State/StateWrapper.php
+++ b/docroot/modules/contrib/devel/webprofiler/src/State/StateWrapper.php
@@ -107,4 +107,7 @@ public function __call($method, $args) {
return call_user_func_array([$this->state, $method], $args);
}

+ public function destruct() {
+ return true;
+ }
}

I am attaching a link to a video in the comments as I think my issues might be getting marked as spam, as I submitted the issue last week but it seems to have vanished.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kylesloan2 created an issue. See original summary.

kylesloan2’s picture

Link to video showing broken action: https://www.youtube.com/watch?v=X2Ip_gDoSvQ&t=1s

kylesloan2’s picture

Yes it seems to not want to let me post the link to the video... anyway not much to see other then what I described.

kylesloan2’s picture

lussoluca’s picture

Status: Active » Needs review
FileSize
1018 bytes

Could you please try with this patch

kylesloan2’s picture

Sorry for the delay, I didn't see the new patch until now. Yes, from my testing, destruct_method-2887471-5.patch makes webprofiler work out of the box for me.

kylesloan2’s picture

Status: Needs review » Reviewed & tested by the community

  • lussoluca committed 7db6e6c on 8.x-1.x
    Issue #2887471 by kylesloan2, lussoluca: destruct method missing, 404s...
lussoluca’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x-1.x
Thanks!

lussoluca’s picture

Status: Fixed » Closed (fixed)
selinav’s picture

I have no error with the patch #5 but the display bar doesn't appears.

lussoluca’s picture

Hi selinav,
could you provide us more details?
Do you notice some javascript errors?

selinav’s picture

Js message error get with firebug :

NetworkError: 500 500 Service unavailable (with message) - http://localhost/drupalsymfony/fr/profiler/31c748"
31c748
lussoluca’s picture

And if you go to http://localhost/drupalsymfony/fr/profiler/31c748 do you have any errors in page?

selinav’s picture

Fatal error: Call to undefined method Symfony\Component\EventDispatcher\Debug\WrappedListener::getSubscribedEvents() in C:\wamp64\www\drupalsymfony\modules\webprofiler\src\DataCollector\EventsDataCollector.php on line 52

lussoluca’s picture

Which version of webprofiler are you using?
From your path (C:\wamp64\www\drupalsymfony\modules\webprofiler) it seems that you are using the old standalone webprofiler. Now webprofiler is part of Devel and the path should be something like C:\wamp64\www\drupalsymfony\modules\devel\webprofiler

Try with the latest version.

selinav’s picture

Sorry it works now. I have installed two times webprofiler. The stand alone module and with devel.
Thanks for your reply.