Issue Bug Closed

#109609PreviewUriBuilder::withRootLine() returns unchanged object

Thomas Kühnel 04/16/26, 15:33 updated 04/21/26, 11:30

Description

In TYPO3\CMS\Backend\Routing\PreviewUriBuilder the method withRootLine() returns an unchanged object.

    /**
     * @param array $rootLine (alternative) root-line of pages
     * @return static
     */
    public function withRootLine(array $rootLine): self
    {
        if ($this->rootLine === $rootLine) {
            return $this;
        }
        $target = clone $this;
        $target->rootLine = $rootLine;
        return $this;
    }

Instead of

return $this;

this should be returned

return $target;

Reviews 2

History 35

  1. Thomas Kühnel commented <span data-processor="relativetime" data-value="2026-04-16T16:15:56+00:00" > 04/16/26, 16:15 </span>

    To be more precise: Instead of

    $target->rootLine = $rootLine;
    return $this;

    this should be returned

    $target->rootLine = $rootLine;
    return $target;
  2. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-04-17T11:10:10+00:00" > 04/17/26, 11:10 </span>

    Applied in changeset commit:39290a9fe7ca51747ea9b9df539741d41a8acf09.