-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.3
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
When writing GDPR extracts, the path names used to represent contexts within the system can be very long. This contributes to problems for users on Windows (see MDL-62617).
In addition, the paths can be strange - where a context id would normally appear, if it is very long, the context id is not included and instead there is a hash at the end of the string. This seems to me like a bug.
Here is an example context path (this is a real example from our system so please forgive the weird bits):
System 1/Category Recycle bin_.2629538/Website D849-12E Introduction to quantitative and qualitative research methods_.602872/Wiki Activity 2.72.8 wiki advantages and disadvantages of self-completion questionnaire - d52285d245/
This path is 226 characters long and we haven't even had any files or data yet. In addition, look at the last element of the path:
Wiki Activity 2.72.8 wiki advantages and disadvantages of self-completion questionnaire - d52285d245
The logic used to construct each element, in the function get_context_path in privacy/classes/local/request/moodle_context_writer.php, is:
1. Get the context name
2. Add on a space and the context id
3. Trim to max 100 characters, adding weird hash if it's longer.
In this case, the frankly weird name of the wiki is already longer than 100 characters, which means that the context id gets trimmed off.
I propose this solution to both improve the chance of it working in Windows, and also consistently include the context id:
1. Get the context name and trim this to a more reasonable length, say 32 characters.
2. Then add on the _. and context id.
The context path will always be unique (because of having the id in) and will not be too long. The example given would turn into
System 1/Category Recycle bin_.2629538/Website D849-12E Introduction t....602872/Wiki Activity 2.72.8 wiki advan....943106/
Which is a much more reasonable 120-ish characters long, and now if there are two wikis with a similar name, they can be distinguished by context ids, instead of by arbitrary hashes.
- will help resolve
-
MDL-62617 GDPR data export: length of file and folder name problem
- Open