Skip to content

Commit 82786d1

Browse files
committed
fix migration
1 parent 354129b commit 82786d1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

includes/class-migration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ public static function migrate_to_4_1_0() {
342342
case 'content':
343343
$template = "[ap_content]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]";
344344
break;
345+
case 'custom':
346+
$template = \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT );
347+
break;
345348
default:
346349
$template = ACTIVITYPUB_CUSTOM_POST_CONTENT;
347350
break;

tests/test-class-activitypub-migrate.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,18 @@ public function test_migrate_to_4_1_0() {
142142

143143
$this->assertEquals( "[ap_content]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]", $template );
144144
$this->assertFalse( $content_type );
145+
146+
$custom = "[ap_title] [ap_content] [ap_hashcats] [ap_authorurl]";
147+
148+
\update_option( 'activitypub_post_content_type', 'custom' );
149+
\update_option( 'activitypub_custom_post_content', $custom );
150+
151+
\Activitypub\Migration::migrate_to_4_1_0();
152+
153+
$template = \get_option( 'activitypub_custom_post_content' );
154+
$content_type = \get_option( 'activitypub_post_content_type' );
155+
156+
$this->assertEquals( $custom, $template );
157+
$this->assertFalse( $content_type );
145158
}
146159
}

0 commit comments

Comments
 (0)