Skip to content

Commit

Permalink
Don't use extra udates for http requests
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Nov 16, 2023
1 parent b1bfd82 commit 734b888
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions application/controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,25 @@ public function indexAction()
$this->controls->getAttributes()->add('class', 'default-layout');
$this->addControl($this->assembleActions());

/** @var string $contentId */
$contentId = $this->content->getAttributes()->get('id')->getValue();
$this->sendExtraUpdates([
$contentId => Url::fromPath('reporting/report/content', ['id' => $this->report->getId()])
]);

// Will be replaced once the report content is rendered
$this->addContent(new HtmlElement('div'));
if ($this->isXhr()) {
/** @var string $contentId */
$contentId = $this->content->getAttributes()->get('id')->getValue();
$this->sendExtraUpdates([
$contentId => Url::fromPath('reporting/report/content', ['id' => $this->report->getId()])
]);

// Will be replaced once the report content is rendered
$this->addContent(new HtmlElement('div'));
} else {
Environment::raiseExecutionTime();
Environment::raiseMemoryLimit();

try {
$this->addContent($this->report->toHtml());
} catch (Exception $e) {
$this->addContent(Error::show($e));
}
}
}

public function contentAction(): void
Expand Down

0 comments on commit 734b888

Please sign in to comment.