Skip to content
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
13 changes: 10 additions & 3 deletions components/ILIAS/COPage/Editor/Server/class.Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public function reply(): void
$response = $action_handler->handle($query);
} else {
//sleep(5);
// Argument #2 ($body) must be of type array, null given
if (!is_array($body)) {
$body = array();
}
$action_handler = $this->getActionHandlerForCommand($query, $body);
$response = $action_handler->handle($query, $body);
}
Expand Down Expand Up @@ -115,8 +119,10 @@ protected function getActionHandlerForCommand(
array $body
): CommandActionHandler {
$handler = null;

switch ($body["component"]) {
//Undefined array key "component
//switch ($body["component"]) {
$component = isset($body['component']) ? $body['component'] : null;
switch ($component) {
case "Paragraph":
$handler = new ParagraphCommandActionHandler($this->page_gui);
break;
Expand Down Expand Up @@ -157,7 +163,8 @@ protected function getActionHandlerForCommand(
}

if ($handler === null) {
throw new Exception("Unknown component " . ((string) $body["component"]));
// throw new Exception("Unknown component " . ((string) $body["component"]));
throw new Exception("Unknown component " . ((string) $component))
}
return $handler;
}
Expand Down
Loading