[wp-trac] [WordPress Trac] #63931: Deleting a parent comment causes the child to move up a level

WordPress Trac noreply at wordpress.org
Sun Sep 14 22:03:31 UTC 2025


#63931: Deleting a parent comment causes the child to move up a level
---------------------------------------+-----------------------------
 Reporter:  oglekler                   |       Owner:  (none)
     Type:  enhancement                |      Status:  new
 Priority:  normal                     |   Milestone:  Future Release
Component:  Comments                   |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-test-info 2nd-opinion  |     Focuses:
---------------------------------------+-----------------------------

Comment (by peterwilsoncc):

 Replying to [comment:18 SirLouen]:
 > Not necessarily. Placeholder can be founded in pure logic.
 > Currently the comment creation and deletion logic is the following:
 > 1. Childs get `comment_parent` ID
 > 2. When you delete permanently, the child `comment_parent` is updated.
 >
 > Remove this logic. Keep `comment_parent` ID forever even if parent
 doesn't exist anymore.
 > When writing the comments tree, if `comment_parent` does not exist, put
 a placeholder, if not, put the `comment_parent`.
 > This could place placeholders not only on the first parent but in any
 parent of the tree.

 This logic would be incomplete.

 If the deleted comment is a child, then the thread would be detacted
 without retaining an object

 - Top level comment, ID 1
    - Deleted comment, parent 1, ID 2
       - Comment, parent 2, ID 3

 Without a placeholder for the deleted comment the continuation of the
 thread would become detached from comment one. The only way to accurately
 record a deleted comment would be to prevent the deletion of objects from
 the database.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63931#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list