Skip to content

Commit 9994dbf

Browse files
pfefferlematticbot
andauthored
Follower Model: Fall back to post-meta (#1781)
Co-authored-by: Automattic Bot <[email protected]>
1 parent 4599071 commit 9994dbf

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Added fallback for follower list during migration to new database schema.

includes/model/class-follower.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,14 @@ public function get_shared_inbox() {
364364
* @return Follower|false The Follower object or false on failure.
365365
*/
366366
public static function init_from_cpt( $post ) {
367+
if ( empty( $post->post_content ) ) {
368+
$json = \get_post_meta( $post->ID, '_activitypub_actor_json', true );
369+
} else {
370+
$json = $post->post_content;
371+
}
372+
367373
/* @var Follower $object Follower object. */
368-
$object = self::init_from_json( $post->post_content );
374+
$object = self::init_from_json( $json );
369375

370376
if ( is_wp_error( $object ) ) {
371377
return false;

0 commit comments

Comments
 (0)