Skip to content

When deleting and restoring an admin, UserGroups relations are not restored #386

@xyz1123581321

Description

@xyz1123581321

Winter CMS Build

1.1

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

I want to prevent User Group deletion when an admin is deleted. The records exists but not the relations. After restoring the admin, groups are not restored.

Tried with changing the core User.php file with:

public $belongsToMany = [
        'groups' => [UserGroup::class, 'table' => 'backend_users_groups', 'softDelete' => true]
];

Doesnt help. I even tried to modify SoftDelete trait and commented out the methods for deleting the relations, doesnt help either.

Steps to replicate

.

Workaround

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions