forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-76354 competency: export user privacy data unconditionally.
We should ensure that any past competency data for a user is always exported, regardless whether competencies are currently enabled.
- Loading branch information
1 parent
df502b3
commit 363942c
Showing
1 changed file
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,7 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Data provider. | ||
* | ||
* @package core_competency | ||
* @copyright 2018 Frédéric Massart | ||
* @author Frédéric Massart <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace core_competency\privacy; | ||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
use context; | ||
use context_course; | ||
|
@@ -584,9 +574,16 @@ public static function get_users_in_context(userlist $userlist) { | |
/** | ||
* Export all user data for the specified user, in the specified contexts. | ||
* | ||
* We skip the enabled check for competencies, as there could be historical data. This avoids exceptions thrown from | ||
* the {@see api::require_enabled} method, which is called at various points during export via the competency API | ||
* | ||
* @param approved_contextlist $contextlist The approved contexts to export information for. | ||
*/ | ||
public static function export_user_data(approved_contextlist $contextlist) { | ||
|
||
// Export even if competencies are not currently enabled. | ||
api::skip_enabled(); | ||
|
||
$user = $contextlist->get_user(); | ||
$userid = $user->id; | ||
|
||
|