Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10 mantis ilias 42692 #8435

Open
wants to merge 1 commit into
base: release_10
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions components/ILIAS/Export/classes/ExportHandler/Manager/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,15 @@ public function createContainerExport(
$repository = $this->export_handler->repository();
foreach ($container_export_info->getExportInfos() as $export_info) {
$stream = null;
# Test, TestQuestionPool special case (Test does not return a xml export)
$special_case = in_array($export_info->getTarget()->getType(), ["tst", "qpl"]);
if ($special_case) {
$this->createExport($user_id, $export_info, "");
$stream = Streams::ofResource(fopen($export_info->getLegacyExportRunDir() . ".zip", 'r'));
}
if (!$special_case) {
$keys = $repository->key()->collection()
->withElement($repository->key()->handler()->withObjectId($export_info->getTargetObjectId()));
$element = $export_info->getReuseExport()
? $this->export_handler->repository()->handler()->getElements($keys)->newest()
: $this->createExport($user_id, $export_info, "");
$element = $element->getIRSS()->isContainerExport()
? $this->createExport($user_id, $export_info, "")
: $element;
$stream = $element->getIRSSInfo()->getStream();
}
$keys = $repository->key()->collection()
->withElement($repository->key()->handler()->withObjectId($export_info->getTargetObjectId()));
$element = $export_info->getReuseExport()
? $this->export_handler->repository()->handler()->getElements($keys)->newest()
: $this->createExport($user_id, $export_info, "");
$element = $element->getIRSS()->isContainerExport()
? $this->createExport($user_id, $export_info, "")
: $element;
$stream = $element->getIRSSInfo()->getStream();
$zip_reader = new ZipReader($stream);
$zip_structure = $zip_reader->getStructure();
foreach ($zip_structure as $path_inside_zip => $item) {
Expand Down Expand Up @@ -176,17 +168,6 @@ public function createExport(
# delete legacy export run dir
# tmp solution, remove if no longer needed
ilFileUtils::delDir($export_info->getLegacyExportRunDir());

# Test special case
# Remove export if the component is Test, TestQuestionPool
if (in_array($export_info->getTarget()->getType(), ["tst", "qpl"])) {
$keys = $this->export_handler->repository()->key()->collection()
->withElement($element->getKey());
$this->export_handler->repository()->handler()->deleteElements(
$keys,
$stakeholder
);
}
return $element;
}

Expand Down
Loading