*

kriskoyk

  • *****
  • 285 posts
Remove business profile-delete account from user.
« on: May 09, 2021, 11:27:39 PM »
- How can the user delete his business profile without deleting his account?

- The user when he has a business profile can not delete his account.

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #1 on: May 10, 2021, 11:39:56 AM »
@kriskoyk
Admin can remove business profile of user.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 285 posts
Re: Remove business profile-delete account from user.
« Reply #2 on: May 10, 2021, 03:59:47 PM »
1-How can it be done so that the user deletes his own business profile himself
2- When there is a business profile the user can not delete his account. Can this be changed so that the user can delete his account even when he has a business profile?

I'm not sure but I think these are also required by the European regulation (GDPR).
« Last Edit: May 10, 2021, 04:03:16 PM by kriskoyk »

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #3 on: May 12, 2021, 12:32:17 PM »
@kriskoyk
1) As mentioned above, only admin has this privilege.
2) User account removal has nothing common with Business profile.
3) Business profile is extension to user profile, that means it does not change the way how GDPR looks on your site.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 285 posts
Re: Remove business profile-delete account from user.
« Reply #4 on: May 12, 2021, 09:00:59 PM »
1. The question is how to change this privilege so that the user has it
2. As I mentioned above, the user can not delete his account when he has a business profile. In order to be able to delete his account, the administrator must first remove his business profile. The question here is: How can I change this so that the user can delete his account whether he has a business profile or not?

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #5 on: May 13, 2021, 07:19:58 AM »
@kriskoyk
1) it's about functionality of plugin, not privileges
2) Not sure why this should not be possible. If it does not work, make sure you have foreign key on bpr table (on cascade update on delete update) for fk_i_user_id referencing to pk_i_id of t_user table
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 285 posts
Re: Remove business profile-delete account from user.
« Reply #6 on: May 18, 2021, 10:24:27 PM »
1) How can this functionality be changed so that the user can also remove his profile?
---------------------
2) The foreign key in fk_i_user_id exists and is the same as the one in pk_i_id of the table t_user.
In the bpr table in the pk_i_id column the key is different.

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #7 on: May 19, 2021, 11:53:14 AM »
@kriskoyk
1) create code, design button and functionality to add such option.
2) https://dev.mysql.com/doc/refman/8.0/en/create-table-foreign-keys.html
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 285 posts
Re: Remove business profile-delete account from user.
« Reply #8 on: May 19, 2021, 07:19:00 PM »
1) Ok we leave this, in the future we will see what happens.

2) The foreign key exists and works properly. Maybe something else is preventing the user account from being deleted. And of course this only happens if the user also has a business profile. I searched for it in the link you wrote but I did not find any solution. If there is another proposal it is fine, otherwise we leave it for the future.

Thanks for the help

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #9 on: May 20, 2021, 09:27:31 AM »
@kriskoyk
If foreign key is in place, once user remove it's account, business profile is removed and your question is solved.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 285 posts
Re: Remove business profile-delete account from user.
« Reply #10 on: May 20, 2021, 10:38:39 AM »
This is exactly the problem. The User account is not deleted when there is a business profile.

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #11 on: May 20, 2021, 10:43:26 AM »
@kriskoyk
Then your foreign key is not correct, as one with "cascade" will not block removal
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 285 posts
Re: Remove business profile-delete account from user.
« Reply #12 on: May 20, 2021, 11:23:17 AM »
I do not know what this "cascade" is and all that is left is to temporarily remove the add-on "Business Profile". I removed it and now everything works fine. Thanks again for the help.

*

MB Themes

Re: Remove business profile-delete account from user.
« Reply #13 on: May 21, 2021, 11:11:15 AM »
@kriskoyk
I've just did testing.
Struct.sql of plugin generates this foreign key.
  FOREIGN KEY (fk_i_user_id) REFERENCES /*TABLE_PREFIX*/t_user (pk_i_id) ON DELETE CASCADE ON UPDATE CASCADE

On database I did:
1. created new user in t_user table
2. created new profile for newly created user in t_user_business_profile table (fk_i_user_id set to t_user.pk_i_id value)
3. removed this record from t_user table (user removal)
4. this action was cascaded to t_user_business_profile table and removed business profile
5. both, user profile and business profile were removed.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots