Commit 1daa125a authored by lussoluca's avatar lussoluca Committed by lussoluca

Issue #2897792 by lussoluca: Warning Illegal string offset 'status_code' and...

Issue #2897792 by lussoluca: Warning Illegal string offset 'status_code' and 'status_text' on database profiler page
parent e41485e2
......@@ -7,6 +7,13 @@ namespace Drupal\webprofiler\DataCollector;
*/
trait DrupalDataCollectorTrait {
/**
* {@inheritdoc}
*/
public function reset() {
$this->data = array();
}
/**
* {@inheritdoc}
*/
......
......@@ -52,6 +52,8 @@ class RequestDataCollector extends BaseRequestDataCollector implements DrupalDat
* @param $service_id
* @param $callable
* @param $request
*
* @throws \ReflectionException
*/
public function addAccessCheck($service_id, $callable, Request $request) {
$this->accessCheck[$request->getPathInfo()][] = [
......@@ -60,6 +62,19 @@ class RequestDataCollector extends BaseRequestDataCollector implements DrupalDat
];
}
/**
* {@inheritdoc}
*
* In Symfony 3 the data for the RequestDataCollector are converted to string
* with \Symfony\Component\HttpKernel\DataCollector/DataCollector::cloneVar()
* in
* \Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::lateCollect(),
* but for some reasons they aren't unserialized back to array later. At the
* moment we simply override that method to avoid conversion.
*/
public function lateCollect() {
}
/**
* {@inheritdoc}
*/
......@@ -71,7 +86,7 @@ class RequestDataCollector extends BaseRequestDataCollector implements DrupalDat
* {@inheritdoc}
*/
public function getPanelSummary() {
return $this->data['status_code'].' '.$this->data['status_text'];
return $this->data['status_code'] . ' ' . $this->data['status_text'];
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment