updated contrib modules

This commit is contained in:
Bachir Soussi Chiadmi
2017-11-14 16:12:58 +01:00
parent c2b4e25be4
commit b32fe9ef14
317 changed files with 4672 additions and 13347 deletions
@@ -56,7 +56,7 @@ class DatabaseDataCollector extends DataCollector implements DrupalDataCollector
unset($query['caller']['args']);
// Remove query args element if empty.
if (empty($query['args'])) {
if (isset($query['args']) && empty($query['args'])) {
unset($query['args']);
}
@@ -223,8 +223,11 @@ class DatabaseDataCollector extends DataCollector implements DrupalDataCollector
$query['type'] = $type;
$quoted = [];
foreach ((array) $query['args'] as $key => $val) {
$quoted[$key] = is_null($val) ? 'NULL' : $conn->quote($val);
if (isset($query['args'])) {
foreach ((array) $query['args'] as $key => $val) {
$quoted[$key] = is_null($val) ? 'NULL' : $conn->quote($val);
}
}
$query['query_args'] = strtr($query['query'], $quoted);
@@ -108,6 +108,13 @@ class ConfigEntityStorageDecorator extends EntityDecorator implements ConfigEnti
return $this->getOriginalObject()->save($entity);
}
/**
* {@inheritdoc}
*/
public function hasData() {
return $this->getOriginalObject()->hasData();
}
/**
* {@inheritdoc}
*/
@@ -4,6 +4,7 @@ namespace Drupal\webprofiler\EventDispatcher;
use Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher;
use Drupal\webprofiler\Stopwatch;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\KernelEvents;
@@ -29,10 +30,19 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements
protected $notCalledListeners;
/**
* @param \Drupal\webprofiler\Stopwatch $stopwatch
* {@inheritdoc}
*/
public function setStopwatch(Stopwatch $stopwatch) {
$this->stopwatch = $stopwatch;
public function __construct(ContainerInterface $container, array $listeners = []) {
parent::__construct($container, $listeners);
$this->notCalledListeners = $listeners;
}
/**
* {@inheritdoc}
*/
public function addListener($event_name, $listener, $priority = 0) {
parent::addListener($event_name, $listener, $priority);
$this->notCalledListeners[$event_name][$priority][] = ['callable' => $listener];
}
/**
@@ -97,6 +107,13 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements
return $this->notCalledListeners;
}
/**
* @param \Drupal\webprofiler\Stopwatch $stopwatch
*/
public function setStopwatch(Stopwatch $stopwatch) {
$this->stopwatch = $stopwatch;
}
/**
* Called before dispatching the event.
*
@@ -158,38 +175,19 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements
'method' => $definition['callable'][1],
];
// Remove this listener from the $notCalledListeners array.
if (!$this->notCalledListeners) {
$this->notCalledListeners = $this->cloneListeners($this->listeners);
}
foreach ($this->notCalledListeners[$event_name][$priority] as $key => $listener) {
if ($listener['service'][0] == $definition['service'][0] && $listener['service'][1] == $definition['service'][1]) {
unset($this->notCalledListeners[$event_name][$priority][$key]);
}
}
}
/**
* @param $listeners
*
* @return array
*/
private function cloneListeners($listeners) {
$clone = [];
foreach ($listeners as $eventName => $events) {
foreach ($events as $priorityValue => $priorities) {
foreach ($priorities as $key => $listener) {
$clone[$eventName][$priorityValue][$key]['service'] = [
$listener['service'][0],
$listener['service'][1]
];
if (isset($listener['service'])) {
if ($listener['service'][0] == $definition['service'][0] && $listener['service'][1] == $definition['service'][1]) {
unset($this->notCalledListeners[$event_name][$priority][$key]);
}
}
else {
if (get_class($listener['callable'][0]) == get_class($definition['callable'][0]) && $listener['callable'][1] == $definition['callable'][1]) {
unset($this->notCalledListeners[$event_name][$priority][$key]);
}
}
}
return $clone;
}
}
}
@@ -134,7 +134,7 @@ class ConfigForm extends ConfigFormBase {
'#states' => array(
'visible' => array(
array(
':input[name="active_toolbar_items[database]' => array('checked' => TRUE),
'input[name="active_toolbar_items[database]"]' => array('checked' => TRUE),
),
),
),
@@ -31,7 +31,7 @@ class TraceableViewExecutable extends ViewExecutable {
* @return float
*/
public function getExecuteTime() {
return $this->execute_time;
return property_exists($this, 'execute_time') ? $this->execute_time : 0.0;
}
/**
@@ -9,8 +9,8 @@ tags:
dependencies:
- devel
# Information added by Drupal.org packaging script on 2017-08-14
version: '8.x-1.0'
# Information added by Drupal.org packaging script on 2017-10-05
version: '8.x-1.2'
core: '8.x'
project: 'devel'
datestamp: 1502732047
datestamp: 1507197848