Skip to content

Commit

Permalink
Restore new teammemberprofilefield filter correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Aug 28, 2024
1 parent e3bdb55 commit 891a323
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backup/moodle2/restore_datalynx_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ protected function process_datalynx_filter($data) {
foreach ($customsearch as $searchfield => $options) {
if (is_numeric($searchfield) && $searchfield > 0) {
$searchfields[$this->get_mappingid('datalynx_field', $searchfield)] = $options;
} else if (str_contains($searchfield, 'entryteammemberprofilefield_')) {
// Check for filter of entryteammemberprofilefield.
// It has pattern entryteammemberprofilefield_fieldid_profielfieldname.
// Example: entryteammemberprofilefield_1026_department
preg_match('/entryteammemberprofilefield_(\d+)_(.+)/', $searchfield, $matches);
if (is_numeric($matches[1])) {
$newfieldid = $this->get_mappingid('datalynx_field', $matches[1]);
$newname = "entryteammemberprofilefield_{$newfieldid}_{$matches[2]}";
$searchfields[$newname] = $options;
}
} else {
$searchfields[$searchfield] = $options;
}
Expand Down

0 comments on commit 891a323

Please sign in to comment.