[ticket/17627] Carry topic views over when merging posts deletes the topic#7001
Open
ECYaz wants to merge 1 commit into
Open
[ticket/17627] Carry topic views over when merging posts deletes the topic#7001ECYaz wants to merge 1 commit into
ECYaz wants to merge 1 commit into
Conversation
…topic The MCP merge topics action already keeps the highest view count of the merged topics (PHPBB-14795), but merging all of a topic's posts into another topic via the MCP topic view left the destination topic's view count untouched, losing the merged topic's views. PHPBB-17627
|
The attempt to merge branch
This PR is ready to be merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging topics from the MCP forum view (merge_topics) has kept the highest view count of the merged topics since PHPBB-14795. Merging a whole topic into another one via the MCP topic view or the quickmod "Merge topic" option (merge_posts) never received the same treatment: when all of a topic's posts are moved and the emptied topic is deleted, its view count is silently lost.
This applies the established behaviour to merge_posts(): the destination topic takes the maximum of both topics' view counts, and only when the source topic was fully merged away. Partially merged topics keep their counts untouched. Using the maximum rather than the sum follows the explicit decision made in PHPBB-14795.
Covered by a new functional test that performs the full merge through the MCP and asserts the destination topic inherits the higher view count once the source topic is gone.
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17627