Platform does not sound like a normal page, is it a Custom File or an external page? If it is Custom File, make sure the URL is correct. You can check valid routes and URLs by php bin/console router:debug, see Console Commands.
If you have added the route recently or using "production" mode, make sure you have cleared cache, read: Clearing Symfony Cache.
While reviewing the code, I noticed something that may need clarification.
In page classes, terminate() can set:
$this->Response = new RedirectResponse(GetUrl($url), Config("REDIRECT_STATUS_CODE"));
However, in BaseController::runPage(), $page->Response is only checked before page rendering:
if (($response = $page->Response) instanceof Response) {
...
$page->terminate();
}
Later, terminate() is called again, but I cannot find any code that re-reads $page->Response after terminate() has executed.
From my reading, if terminate() creates a new RedirectResponse, that response does not appear to be assigned back to the controller's $response variable and therefore may never be returned.
Am I missing another location where $page->Response is consumed after terminate() runs, or is the Response created inside terminate() no longer used in the Symfony-based architecture?
I noticed another potential issue related to IsModal.
In terminate() there is logic like:
if ($this->IsModal) {
...
}
However, IsModal is typically assigned during run():
public function run(): void
{
// Is modal
$this->IsModal = IsModal();
}
I have encountered cases where terminate() is executed before run() (or before other methods that initialize $this->IsModal). In those situations, $this->IsModal may not contain the expected value, which can lead to incorrect behavior.
As a workaround, I have sometimes used:
public function pageUnload(): void
{
$this->IsModal = IsModal();
}
to ensure the property is initialized before terminate() uses it.
Would it be safer for terminate() to call IsModal() directly instead of relying on $this->IsModal, for example:
if (IsModal()) {
...
}
or is there another part of the framework lifecycle that guarantees $this->IsModal has already been initialized before terminate() is called?