From 95535e48e8b620ed1669abe53884ddd95a25daaa Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Tue, 29 May 2018 19:22:12 -0300 Subject: [PATCH] check if is a fetch empty result --- src/classes/repositories/class-tainacan-repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/repositories/class-tainacan-repository.php b/src/classes/repositories/class-tainacan-repository.php index 8126b205a..c59702864 100644 --- a/src/classes/repositories/class-tainacan-repository.php +++ b/src/classes/repositories/class-tainacan-repository.php @@ -658,7 +658,7 @@ abstract class Repository { public function diff( $old = 0, $new ) { $old_entity = null; - if ( $old === 0 ) { // self diff or other entity? + if ( $old === 0 || is_array($old) && count($old) == 0 ) { // self diff or other entity? $id = $new->get_id(); if ( ! empty( $id ) ) { // there is a repository entity?