Skip to content

[FIX] HTMLLearningModule #48169: Copy files when copying an HTML lear… - #11865

Open
faborg wants to merge 1 commit into
ILIAS-eLearning:release_10from
rzunibw:fix-48169-htlm-copy-files
Open

[FIX] HTMLLearningModule #48169: Copy files when copying an HTML lear…#11865
faborg wants to merge 1 commit into
ILIAS-eLearning:release_10from
rzunibw:fix-48169-htlm-copy-files

Conversation

@faborg

@faborg faborg commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

…ning module

https://mantis.ilias.de/view.php?id=48169

Since ILIAS 10 the files of an HTML learning module are no longer stored in data//lm_data/lm_ but in an IRSS container resource referenced by file_based_lm.rid. ilHTLMMigration moves the files there and removes the legacy directory.

ilObjFileBasedLM::cloneObject() was not adapted and still copied the legacy directory only. For migrated modules that directory is gone, so the copy kept the empty container resource created by ilObjFileBasedLM::create() and ended up without any files.

Changes in ilObjFileBasedLM:

  • Add cloneContainerResource(), which removes the empty container resource of the target object and replaces its RID with a clone of the source container (ContainerManager::clone()). This mirrors the way MediaObjects and content styles already clone their containers.
  • Call it from cloneObject(); the subsequent update() persists the new RID together with the start file.
  • Keep the legacy populateByDirectoy() call, but only when the data directory actually exists, so installations that have not run the migration yet still copy their content.

…ning module

https://mantis.ilias.de/view.php?id=48169

Since ILIAS 10 the files of an HTML learning module are no longer stored
in data/<client>/lm_data/lm_<id> but in an IRSS container resource
referenced by file_based_lm.rid. ilHTLMMigration moves the files there
and removes the legacy directory.

ilObjFileBasedLM::cloneObject() was not adapted and still copied the
legacy directory only. For migrated modules that directory is gone, so
the copy kept the empty container resource created by
ilObjFileBasedLM::create() and ended up without any files.

Changes in ilObjFileBasedLM:
- Add cloneContainerResource(), which removes the empty container
  resource of the target object and replaces its RID with a clone of the
  source container (ContainerManager::clone()). This mirrors the way
  MediaObjects and content styles already clone their containers.
- Call it from cloneObject(); the subsequent update() persists the new
  RID together with the start file.
- Keep the legacy populateByDirectoy() call, but only when the data
  directory actually exists, so installations that have not run the
  migration yet still copy their content.
@mjansenDatabay mjansenDatabay added bugfix php Pull requests that update Php code labels Aug 6, 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.

3 participants