From 2c6d36105c4be443a73eae1051d0ed2887dc609f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 5 Dec 2018 21:29:48 +0100 Subject: [PATCH] Emit write update only once on touch When a touch is done (i.e. when creating a new file in the node API) The hooks contain 'write' and 'touch' (and the operation is touch as well). This would cause a double write update. Which doesn't make sense. Signed-off-by: Roeland Jago Douma --- lib/private/Files/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 19e3871780..21df67cf55 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1157,7 +1157,7 @@ class View { if ($result && in_array('delete', $hooks) and $result) { $this->removeUpdate($storage, $internalPath); } - if ($result && in_array('write', $hooks) and $operation !== 'fopen') { + if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') { $this->writeUpdate($storage, $internalPath); } if ($result && in_array('touch', $hooks)) {