Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Dec 18, 2025

Supersedes #2664

Proposed changes:

  • Add early return in create_post() to skip post creation when the Reader feature is disabled.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  1. Enable Reader UI
  2. Follow some accounts and let some ap_post posts be created
  3. Disable Reader UI
  4. Have someone on the fediverse create a new post
  5. Verify that no new ap_post is created

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Prevent post creation when Reader is deactivated.

Add early return in create_post() to skip post creation when the
Reader feature is disabled.
Copilot AI review requested due to automatic review settings December 18, 2025 13:28
@pfefferle pfefferle self-assigned this Dec 18, 2025
@pfefferle pfefferle requested a review from a team December 18, 2025 13:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a check to prevent the creation of ap_post entries when the Reader feature is disabled. This addresses an issue where posts were being created even when the Reader UI was turned off.

Key Changes:

  • Added early return in Create::create_post() method to check the activitypub_create_posts option before creating posts
  • Added comprehensive test coverage for both enabled and disabled states

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
includes/handler/class-create.php Added option check at the start of create_post() to return false when activitypub_create_posts is not enabled
tests/phpunit/tests/includes/handler/class-test-create.php Added two new test methods to verify post creation is properly blocked when the option is disabled and works when enabled
.github/changelog/fix-disable-create-posts-option Added changelog entry documenting this bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pfefferle and others added 3 commits December 18, 2025 14:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Simplify maybe_prevent_comment_notification to prevent all comment
email notifications for ap_post regardless of any settings.
@pfefferle pfefferle merged commit 113bdb4 into trunk Dec 18, 2025
12 checks passed
@pfefferle pfefferle deleted the fix/disable-create-posts-option branch December 18, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants