Skip to content

T&A 46734: Fix threshold level mapping on same platform - #12402

Open
lukas-heinrich wants to merge 2 commits into
ILIAS-eLearning:release_11from
lukas-heinrich:fix/11/46734-import-competence-thresholds
Open

lukas-heinrich wants to merge 2 commits into
ILIAS-eLearning:release_11from
lukas-heinrich:fix/11/46734-import-competence-thresholds

Conversation

@lukas-heinrich

Copy link
Copy Markdown
Contributor

Hi everyone,

This PR addresses ticket 46734. The issue described in the ticket occurs specifically only when the test has been exported and then re-imported on the same platform.

Analysis

The cause lies in the method \ilTestSkillLevelThresholdImporter::getLevelIdMapping. There, the import_id column of the skl_level table is searched for entries where the IDs from the source platform match the IDs of the target platform. By default, however, this column is empty. This means that no matches are found when the thresholds are re-imported onto the same platform. Consequently, $mappedLevelId on line 158 is null, and the method is completely terminated by continue(2).

Solution

In this PR, I’m adding an additional check that runs if all previous conditions fail. Specifically, this new condition is executed only if the aforementioned attempt to map the import IDs fails. In this new condition, I check whether the LevelID and SkillID from the export match the records found in the skl_level table. In my opinion, this is a clear indication that the skill level to be imported already exists on the target platform.

I look forward to feedback on this proposal. As always, these changes were reviewed by @thojou during an internal review.

Best
@lukas-heinrich

@dsstrassner dsstrassner added bugfix php Pull requests that update Php code labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants