Merge pull request #10434 from annando/issue-10433
Issue 10433: Only notify when there had been changes
This commit is contained in:
commit
3fe6789c9c
|
@ -159,6 +159,10 @@ class Item
|
||||||
$fields['vid'] = Verb::getID($fields['verb']);
|
$fields['vid'] = Verb::getID($fields['verb']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($fields['edited'])) {
|
||||||
|
$previous = Post::selectFirst(['edited'], $condition);
|
||||||
|
}
|
||||||
|
|
||||||
$rows = Post::update($fields, $condition);
|
$rows = Post::update($fields, $condition);
|
||||||
if (is_bool($rows)) {
|
if (is_bool($rows)) {
|
||||||
return $rows;
|
return $rows;
|
||||||
|
@ -203,8 +207,8 @@ class Item
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only need to notfiy others when it is an original entry from us.
|
// We only need to notfiy others when it is an original entry from us.
|
||||||
// Only call the notifier when the item has some content relevant change.
|
// Only call the notifier when the item had been edited and records had been changed.
|
||||||
if ($item['origin'] && in_array('edited', array_keys($fields))) {
|
if ($item['origin'] && !empty($fields['edited']) && ($previous['edited'] != $fields['edited'])) {
|
||||||
$notify_items[] = $item['id'];
|
$notify_items[] = $item['id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue