Hi all,
I just updated my little project after quite some time to Kirby 3.4.4 and had to migrate my page.update:after hook like written in the 3.4.0 release notes.
I had set up my old hook via trial and error due to lack of knowledge, but it worked fine so far. Now after the migration, it is working so far, that my content is getting updated like expected in the content file after saving page changes, but these changes are not visible in the panel. I only can see them after reloading the page.
I read the Panel issues guide but can’t find anything with OPCache
or mod_expires
set in my installation.
Actually, I am not sure about my use of $newPage
.
This is my hook:
'page.update:after' => function ($newPage, $oldPage) {
if($newPage->keywords()->exists() && $newPage->keywords()->isNotEmpty()) {
$keywords = $newPage->keywords()->split();
sort($keywords);
$keywords = implode(",",$keywords);
try {
$newPage->update(array(
'keywords' => $keywords,
));
} catch(Exception $e) {
echo $e->getMessage();
}
}
}
Thank you!