Update display cache when the post had been edited

This commit is contained in:
Michael 2022-05-04 07:50:14 +00:00
parent 10b453bfc2
commit 2f74a7bca4

View File

@ -666,21 +666,16 @@ function item_post(App $a) {
$datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']); $datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']);
if ($orig_post) { if ($orig_post) {
// Fill the cache field
// This could be done in Item::update as well - but we have to check for the existance of some fields.
Item::putInCache($datarray);
$fields = [ $fields = [
'title' => $datarray['title'], 'title' => $datarray['title'],
'body' => $datarray['body'], 'body' => $datarray['body'],
'attach' => $datarray['attach'], 'attach' => $datarray['attach'],
'file' => $datarray['file'], 'file' => $datarray['file'],
'rendered-html' => $datarray['rendered-html'],
'rendered-hash' => $datarray['rendered-hash'],
'edited' => DateTimeFormat::utcNow(), 'edited' => DateTimeFormat::utcNow(),
'changed' => DateTimeFormat::utcNow()]; 'changed' => DateTimeFormat::utcNow()];
Item::update($fields, ['id' => $post_id]); Item::update($fields, ['id' => $post_id]);
Item::updateDisplayCache($datarray['uri-id']);
if ($return_path) { if ($return_path) {
DI::baseUrl()->redirect($return_path); DI::baseUrl()->redirect($return_path);