Skip to content

Commit 66cd441

Browse files
committed
Presenter: fixed uninitialized $since [Closes #166]
1 parent d0f19fa commit 66cd441

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Application/UI/Presenter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,13 +1087,16 @@ protected function getGlobalState($forClass = NULL): array
10871087
}
10881088

10891089
$components = $this->getReflection()->getPersistentComponents();
1090-
$iterator = $this->getComponents(TRUE, IStatePersistent::class);
1090+
$iterator = $this->getComponents(TRUE);
10911091

10921092
foreach ($iterator as $name => $component) {
10931093
if ($iterator->getDepth() === 0) {
10941094
// counts with Nette\Application\RecursiveIteratorIterator::SELF_FIRST
10951095
$since = $components[$name]['since'] ?? FALSE; // FALSE = nonpersistent
10961096
}
1097+
if (!$component instanceof IStatePersistent) {
1098+
continue;
1099+
}
10971100
$prefix = $component->getUniqueId() . self::NAME_SEPARATOR;
10981101
$params = [];
10991102
$component->saveState($params);

0 commit comments

Comments
 (0)