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 04/16/26, 16:15

    To be more precise: Instead of

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

    this should be returned

    $target->rootLine = $rootLine;
    return $target;
  2. Gerrit Code Review pushed patch set 1 for main to change 93699 status New Under Review 04/16/26, 19:38

  3. Gerrit Code Review pushed patch set 1 for 13.4 to change 93711 04/17/26, 11:04

  4. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % 04/17/26, 11:10

    Applied in changeset commit:39290a9fe7ca51747ea9b9df539741d41a8acf09.

  5. Benni Mack changed status Resolved Closed 04/21/26, 11:30