Fix that the timeline does not regenerate the logarithmical base

refs #4190
This commit is contained in:
Johannes Meyer 2014-04-01 11:43:03 +02:00
parent 2049e42988
commit 19b2a94777
1 changed files with 6 additions and 4 deletions

View File

@ -269,20 +269,22 @@ class TimeLine implements IteratorAggregate
public function getCalculationBase($create)
{
if ($this->calculationBase === null) {
if ($this->session !== null) {
$this->calculationBase = $this->session->get('calculationBase');
}
$calculationBase = $this->session !== null ? $this->session->get('calculationBase') : null;
if ($create) {
$new = $this->generateCalculationBase();
if ($new > $this->calculationBase) {
if ($new > $calculationBase) {
$this->calculationBase = $new;
if ($this->session !== null) {
$this->session->calculationBase = $new;
Session::getSession()->write(); // TODO: Should it be possible to call write() on the namespace?
}
} else {
$this->calculationBase = $calculationBase;
}
} else {
return $calculationBase;
}
}