diff --git a/Services/COPage/DOM/class.DomUtil.php b/Services/COPage/DOM/class.DomUtil.php index 762b53810a93..ee589f4f963e 100644 --- a/Services/COPage/DOM/class.DomUtil.php +++ b/Services/COPage/DOM/class.DomUtil.php @@ -145,8 +145,8 @@ public function deleteAllChildsByName( public function deleteAllChilds( \DOMNode $parent ): void { - foreach ($parent->childNodes as $child) { - $parent->removeChild($child); + while ($parent->hasChildNodes()) { + $parent->removeChild($parent->firstChild); } } diff --git a/Services/COPage/PC/Paragraph/class.ilPCParagraph.php b/Services/COPage/PC/Paragraph/class.ilPCParagraph.php index b18cdca7050f..64295fb2aaf4 100755 --- a/Services/COPage/PC/Paragraph/class.ilPCParagraph.php +++ b/Services/COPage/PC/Paragraph/class.ilPCParagraph.php @@ -162,7 +162,6 @@ public function setText( $error = $this->checkTextArray($text); $orig_characteristic = ""; - // remove all childs if (empty($error)) { $t = $text[0]["text"] ?? ""; diff --git a/Services/COPage/PC/SourceCode/class.SourceCodeCommandActionHandler.php b/Services/COPage/PC/SourceCode/class.SourceCodeCommandActionHandler.php index 08fe37da191b..f2758ccbc73b 100644 --- a/Services/COPage/PC/SourceCode/class.SourceCodeCommandActionHandler.php +++ b/Services/COPage/PC/SourceCode/class.SourceCodeCommandActionHandler.php @@ -69,8 +69,7 @@ protected function insertCommand(array $body): Server\Response $hier_id = $hier_ids[$body["after_pcid"]]; $pc_id = $body["after_pcid"]; } - - $manual = ((string) ($body["form_input_1"] ?? "") === "manual"); + $manual = ((string) ($body["form/input_0"] ?? "") === "manual"); $src = new \ilPCSourceCode($page); $src->create($page, $hier_id, $pc_id); @@ -113,7 +112,6 @@ protected function updateCommand(array $body): Server\Response /** @var \ilPCSourceCode $pc_src */ $pc_src = $page->getContentObjectForPcId($body["pcid"]); $src_gui = new \ilPCSourceCodeGUI($page, $pc_src, "", $body["pcid"]); - $form = $src_gui->getEditingFormAdapter(); if ($form->isValid()) { $pc_src->setDownloadTitle(str_replace('"', '', $form->getData("title"))); diff --git a/Services/COPage/PC/SourceCode/class.ilPCSourceCode.php b/Services/COPage/PC/SourceCode/class.ilPCSourceCode.php index d5b51018c214..2f8d1b776875 100755 --- a/Services/COPage/PC/SourceCode/class.ilPCSourceCode.php +++ b/Services/COPage/PC/SourceCode/class.ilPCSourceCode.php @@ -46,7 +46,8 @@ public function modifyPageContentPostXsl( foreach ($nodes as $context_node) { $char = $context_node->getAttribute('Characteristic'); - if ($char != "Code") { + if ($char !== "Code") { + $i++; continue; } diff --git a/Services/COPage/PC/SourceCode/class.ilPCSourceCodeGUI.php b/Services/COPage/PC/SourceCode/class.ilPCSourceCodeGUI.php index 7b4f3aee976d..c9770d901c91 100755 --- a/Services/COPage/PC/SourceCode/class.ilPCSourceCodeGUI.php +++ b/Services/COPage/PC/SourceCode/class.ilPCSourceCodeGUI.php @@ -113,8 +113,7 @@ public function edit(): void $this->lng->txt("cont_pc_code") )->withValue($par_content); $t = $this->gui->ui()->renderer()->render($f); - $t = str_replace("