fix cache problem
This commit is contained in:
parent
86f46b59cf
commit
ca0ca3b2a2
2 changed files with 5 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return function($newPage, $oldPage) {
|
return function($newPage, $oldPage) {
|
||||||
if ($newPage->template() == 'project' || $newPage->parents()->findBy('template', 'project')) {
|
if ($newPage->template() == 'project' || $newPage->parents()->findBy('template', 'project')) {
|
||||||
$newPage->getSteps();
|
$newPage->getSteps(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
use adrienpayet\notifications\NotificationsPage;
|
use adrienpayet\notifications\NotificationsPage;
|
||||||
|
|
||||||
class ProjectPage extends NotificationsPage {
|
class ProjectPage extends NotificationsPage {
|
||||||
public function getSteps() {
|
public function getSteps($refreshCache = false) {
|
||||||
$apiCache = kirby()->cache('api');
|
$apiCache = kirby()->cache('api');
|
||||||
$stepsData = $apiCache->get($this->slug() . '_' . 'steps');
|
$stepsData = $apiCache->get($this->slug() . '_' . 'steps');
|
||||||
|
|
||||||
if ($stepsData === null || count($stepsData) === 0) {
|
if ($refreshCache) {
|
||||||
$steps = [];
|
$steps = [];
|
||||||
|
|
||||||
foreach ($this->children() as $child) {
|
foreach ($this->children() as $child) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue