Skip to content

[FIX] #47100 Failed test: Lernsequenz aus alter ILIAS-Version importieren - #12364

Open
kevenClausenKPG wants to merge 1 commit into
ILIAS-eLearning:release_10from
kroepelin-projekte:fix/r10/kc/47100-lso-import-lp-null-ref
Open

kevenClausenKPG wants to merge 1 commit into
ILIAS-eLearning:release_10from
kroepelin-projekte:fix/r10/kc/47100-lso-import-lp-null-ref

Conversation

@kevenClausenKPG

Copy link
Copy Markdown
Contributor

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, gets null for every omitted object and passes the array to activateEntries(). 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 handling ilTrackingImporter::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.

…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.
@kevenClausenKPG kevenClausenKPG added bugfix php Pull requests that update Php code labels Nov 3, 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.

2 participants