panel > project : fix get steps of new projects

This commit is contained in:
isUnknown 2025-05-22 11:37:58 +02:00
parent 462a8e9028
commit 86f46b59cf

View file

@ -7,7 +7,7 @@ class ProjectPage extends NotificationsPage {
$apiCache = kirby()->cache('api');
$stepsData = $apiCache->get($this->slug() . '_' . 'steps');
if ($stepsData === null) {
if ($stepsData === null || count($stepsData) === 0) {
$steps = [];
foreach ($this->children() as $child) {
@ -21,6 +21,7 @@ class ProjectPage extends NotificationsPage {
usort($steps, fn($a, $b) => $a['index'] <=> $b['index']);
$apiCache->set($this->slug() . '_' . 'steps', $steps);
return $steps;
} else {
return $stepsData;