?
avatar dariusz-hub
dariusz-hub
11 Oct 2019

Steps to reproduce the issue

Create custom fields for user.
Create a user account and fill custom fields.
Submit anonymization request.

Expected result

Customfields will be anonymized

Actual result

data is not anonymized

System information (as much as possible)

Joomla! 3.9.12

Additional comments

The following solution would fix the problem:

plugin:
plugins\privacy\user\user.php

new function:

public function anonimizecustomfields($userid){
       // JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
        $userfields = FieldsHelper::getFields('com_users.user', $userid, true);
        $model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true));

        foreach($userfields as $userfield) {
            $model->setFieldValue($userfield->id, $userid, '----');
        }
    }

at the end function:
onPrivacyRemoveData
$this->anonimizecustomfields($user->id);

avatar dariusz-hub dariusz-hub - open - 11 Oct 2019
avatar joomla-cms-bot joomla-cms-bot - change - 11 Oct 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Oct 2019
avatar dariusz-hub dariusz-hub - change - 11 Oct 2019
The description was changed
avatar dariusz-hub dariusz-hub - edited - 11 Oct 2019
avatar SharkyKZ
SharkyKZ - comment - 11 Oct 2019

Related RFC #25849.

avatar Quy Quy - close - 22 Dec 2019
avatar Quy
Quy - comment - 22 Dec 2019

Please comment/test in PR #25849.

avatar Quy Quy - change - 22 Dec 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-12-22 00:32:09
Closed_By Quy

Add a Comment

Login with GitHub to post a comment