From 9463ee1c369493c9a795139d63517d449552e89a Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Wed, 17 Apr 2024 11:44:22 -0300 Subject: [PATCH 1/2] fix: teste if props of terms isset --- src/classes/repositories/class-tainacan-terms.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/repositories/class-tainacan-terms.php b/src/classes/repositories/class-tainacan-terms.php index 9601e675e..8f575d2f6 100644 --- a/src/classes/repositories/class-tainacan-terms.php +++ b/src/classes/repositories/class-tainacan-terms.php @@ -137,7 +137,7 @@ class Terms extends Repository { if ( $mapped['map'] != 'termmeta' ) { $get_ = 'get_' . $prop; - if ( $term->WP_Term->{$mapped['map']} || + if ( isset($term->WP_Term->{$mapped['map']}) || ($mapped['map'] == 'parent' && $term->WP_Term->{$mapped['map']} >= 0) ) { $args[ $mapped['map'] ] = $term->$get_(); @@ -247,6 +247,8 @@ class Terms extends Repository { } public function update( $object, $args = null ) { + error_log( "update:" . json_encode($object) ); + error_log( "update-des:" . json_encode($object->get_description()) ); return $this->insert( $object ); } From 1bc5c4f2c2140b1f947ec07a927984dff7de276d Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Wed, 17 Apr 2024 11:45:53 -0300 Subject: [PATCH 2/2] fix: remove `error_log` --- src/classes/repositories/class-tainacan-terms.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/classes/repositories/class-tainacan-terms.php b/src/classes/repositories/class-tainacan-terms.php index 8f575d2f6..a2b84e32d 100644 --- a/src/classes/repositories/class-tainacan-terms.php +++ b/src/classes/repositories/class-tainacan-terms.php @@ -247,8 +247,6 @@ class Terms extends Repository { } public function update( $object, $args = null ) { - error_log( "update:" . json_encode($object) ); - error_log( "update-des:" . json_encode($object->get_description()) ); return $this->insert( $object ); }