Skip to content

Thread ancestors not updated when using delete cascades #726

Description

@Martin1982

I'm working on a feature where users can remove their account and data (in accordance with GDPR regulations). For this when an author deletes their account their comments are removed with an onDelete="CASCADE" on this column.

In general this works great, until someone has a reply in a comment tree, the ancestor column saves the id's with a slash-delimiter. Once a page with a thread is visited and one of these id's doesn't exist anymore an error is thrown;

Notice: Undefined offset: 3

In the file vendor/friendsofsymfony/comment-bundle/Model/Tree.php (line 62)

It would be nice to have an exception thrown here which can be caught. And it would even be greater if the slash delimited ancestors value can be regenerated upon this exception when it's caught.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions