Repository navigation
[FIX] #47100 Failed test: Lernsequenz aus alter ILIAS-Version importieren - #12364
Open
kevenClausenKPG wants to merge 1 commit into
Open
kevenClausenKPG wants to merge 1 commit into
kevenClausenKPG wants to merge 1 commit into
Conversation
…ings When objects of a learning sequence are omitted on export, the exported LP collection still lists their ref_ids. On import, buildLPSettings() mapped them via the container mapping, got null for the omitted ones and passed them to activateEntries(), which ends in a TypeError in addEntry(int). Unmapped ref_ids are now skipped, like ilTrackingImporter does since 12, and mapped ones are passed as int. The cast is also needed from 12 on, where the collection classes are strictly typed and the string from the mapping is rejected even if nothing was omitted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mantis: https://mantis.ilias.de/view.php?id=47100
Cause
When objects of a learning sequence are omitted on export, the LP collection in the LSO XML still lists their ref_ids (
LPRefId). On import,ilLearningSequenceImporter::buildLPSettings()maps them via the container mapping, getsnullfor every omitted object and passes the array toactivateEntries().addEntry(int)then throws a TypeError.From 12 on the collection classes are strictly typed. There the mapped ref_ids arrive as strings and are rejected as well, so any LSO import with an LP collection fails, even if nothing was omitted.
Change
buildLPSettings()skips ref_ids without a mapping and passes the others as int. This is the same handlingilTrackingImporter::applyMappings()uses for the LP collection since 12.Tested
LSO in a category with two items, LP mode "collection" with both items. Export with item B omitted, then import, and as a counter check an export with nothing omitted. Tests as items on 10 and 11, content pages on 12 and trunk.
The commit applies to release_11, release_12 and trunk without conflicts.