Skip to content

BUGFIX] TYPO3 14: web_edit returns 406 / reload loop with relative site base #31

@tg-seeyou

Description

@tg-seeyou

After a composer update, the Visual Editor became unusable for us on TYPO3 14.2.x-dev.

Opening web_edit for a page caused an endless reload loop in the backend.
The relevant request was:

/typo3/module/web/edit?...&id=1&languages[0]=0

and it returned 406 Not Acceptable.

Environment

  • TYPO3: 14.2.x-dev
  • extension: friendsoftypo3/visual-editor ^1.0 (we had 1.0.7)
  • site config uses a relative base:
    base: /
    languages:
      - languageId: 0
        base: /

What happens
The backend repeatedly reloads web/edit.
In the browser console/network we saw:

repeated navigation to /typo3/module/web/edit?...
406 on that request
then fallback navigation to /typo3/
Root causes we found

  1. Relative site base triggers wrong cross-origin handling
    In Classes/Backend/Controller/PageEditController.php, iframeUrl() compares the generated frontend URI against the backend request origin.

With a relative site base (base: /), TYPO3 generates a relative URI without scheme/host.
That URI is currently treated as if it were a different origin, and the controller throws a 406 with a redirect script.

For us, treating relative URIs as same-origin fixes the reload loop.

Patch logic:

php

if (
    ($uri->getScheme() === '' && $uri->getHost() === '')
    || (
        $uri->getScheme() === $request->getUri()->getScheme()
        && $uri->getHost() === $request->getUri()->getHost()
        && $uri->getPort() === $request->getUri()->getPort()
    )
) {
    return $uri;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions