Commit 51e32017 authored by catch's avatar catch
Browse files

Issue #2067551 by lokapujya, Kartagis, sandipmkhairnar, jlindsey15: ...

Issue #2067551 by lokapujya, Kartagis, sandipmkhairnar, jlindsey15:  /core/lib/Drupal/Core/Routing/MatcherDumper.php will never roll back its transaction.
parent 52d3b493
......@@ -109,19 +109,20 @@ public function dump(array $options = array()) {
// Delete any old records in this provider first, then insert the new ones.
// That avoids stale data. The transaction makes it atomic to avoid
// unstable router states due to random failures.
$txn = $this->connection->startTransaction();
$this->connection->delete($this->tableName)
->condition('provider', $options['provider'])
->execute();
$insert->execute();
// We want to reuse the dumper for multiple providers, so on dump, flush
// the queued routes.
$this->routes = NULL;
// Transaction ends here.
$transaction = $this->connection->startTransaction();
try {
$this->connection->delete($this->tableName)
->condition('provider', $options['provider'])
->execute();
$insert->execute();
// We want to reuse the dumper for multiple providers, so on dump, flush
// the queued routes.
$this->routes = NULL;
} catch (\Exception $e) {
$transaction->rollback();
watchdog_exception('Routing', $e);
throw $e;
}
}
/**
......
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