TYPO3-Documentation/TYPO3CMS-Book-ExtbaseFluid

Fix code 4-FirstExtension/5-controlling-the-flow.rst

Closed this issue · 1 comments

I am not feeling confident with editing it myself through GitHub so I will just comment this here.

There is an error in the "Controlling the flow" page in the tutorial.
Inside the listAction() method the return is given a createHtmlResponse() which seems to not exist. So if you'd be recreating the Extension step-by-step you'd run into this error without knowing why.

public function listAction(): ResponseInterface
   {
      $products = $this->productRepository->findAll();
      $this->view->assign('products', $products);

      return $this->responseFactory->createHtmlResponse($this->view->render());
   }

The code used in the (working) extension "store_inventory" is:

public function listAction(): ResponseInterface
    {
        $products = $this->productRepository->findAll();
        $this->view->assign('products', $products);
        return $this->htmlResponse();
    }

This was probably overseen when the tutorial was updated.

This example was removed as it was severely outdated in many places.

We are in process of removing the Extbase Fluid Book alltogether.