diff --git a/includes/client/posts.php b/includes/client/posts.php index b9144f3..cc20df1 100644 --- a/includes/client/posts.php +++ b/includes/client/posts.php @@ -74,7 +74,7 @@ function post_to_object( $post ) { ); $existing = \pterotype\objects\get_object_by_url( $permalink ); if ( $existing ) { - $object['id'] = $existing->activitypub_id; + $object['id'] = $existing['id']; } return $object; } diff --git a/includes/server/objects.php b/includes/server/objects.php index 57edaa7..1d51d42 100644 --- a/includes/server/objects.php +++ b/includes/server/objects.php @@ -18,7 +18,8 @@ function create_local_object( $object ) { } $object = compact_object( $object ); $res = $wpdb->insert( $wpdb->prefix . 'pterotype_objects', array( - 'object' => wp_json_encode( $object ) + 'object' => wp_json_encode( $object ), + 'activitypub_id' => "uninitialized_" . rand(), ) ); if ( !$res ) { return new \WP_Error(