Skip to content
Snippets Groups Projects
Commit ad396a82 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

use user id as part of the selection id, fixes #986

Closes #986

Merge request studip/studip!569
parent 8086295c
No related branches found
No related tags found
No related merge requests found
...@@ -276,9 +276,10 @@ class MvvOverlappingSelection extends SimpleORMap ...@@ -276,9 +276,10 @@ class MvvOverlappingSelection extends SimpleORMap
* @param string $comp_versions The id of the compared version. * @param string $comp_versions The id of the compared version.
* @param array|string $fachsems An array or a string with comma separated fachsem numbers. * @param array|string $fachsems An array or a string with comma separated fachsem numbers.
* @param array|string $semtypes An array or a string with comma separated course types. * @param array|string $semtypes An array or a string with comma separated course types.
* @param string|null $user_id User id that created the selection (defaults to current user)
* @return string The md5 id. * @return string The md5 id.
*/ */
public static function createSelectionId($base_version, $comp_versions, $fachsems, $semtypes) public static function createSelectionId($base_version, $comp_versions, $fachsems, $semtypes, string $user_id = null)
{ {
if (is_array($fachsems)) { if (is_array($fachsems)) {
sort($fachsems, SORT_NUMERIC); sort($fachsems, SORT_NUMERIC);
...@@ -302,7 +303,8 @@ class MvvOverlappingSelection extends SimpleORMap ...@@ -302,7 +303,8 @@ class MvvOverlappingSelection extends SimpleORMap
$base_version->id, $base_version->id,
$comp_versions, $comp_versions,
trim($fachsems) ? $fachsems : 'x', trim($fachsems) ? $fachsems : 'x',
trim($semtypes) ? $semtypes : 'x' trim($semtypes) ? $semtypes : 'x',
$user_id ?? $GLOBALS['user']->id,
])); ]));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment