I'm trying to implement the privacy API into my local plugin. The local plugin allows for extra data to be defined and assigned to a specific user. I have the definition working fine, and I have created an export function that I can see is executed, but none of the data ends up in the export that I can find.
I believe the problem is that the context I want to associate with in export_user_data is the user context. Perhaps that is wrong? Should I be writing to the system context? Something like:
$context = \context_system::instance();
\core_privacy\local\request\writer::with_context($context)->export_data([], $exportdata);
mike