Skip to content

Commit

Permalink
added upgrade note
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Apr 18, 2017
1 parent c5d6205 commit 296241b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions Controller/WebsiteArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function indexAction(Request $request, ArticleInterface $object, $view, $
* @param ArticleInterface $object
* @param string $view
* @param int $pageNumber
* @param array $attributes
*
* @return Response
*/
Expand Down
42 changes: 42 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@

## dev-develop

### WebsiteArticleController

The multi-page feature needs a refactoring of the ``WebsiteArticleController``.
If you have overwritten it you have to adapt it.

__Before:__

```php
class CustomArticleController extends Controller
{
public function indexAction(Request $request, ArticleDocument $object, $view)
{
$content = $this->get('jms_serializer')->serialize(
$object,
'array',
SerializationContext::create()
->setSerializeNull(true)
->setGroups(['website', 'content'])
->setAttribute('website', true)
);

return $this->render(
$view . '.html.twig',
$this->get('sulu_website.resolver.template_attribute')->resolve($content),
$this->createResponse($request)
);
}
}
```

__After:__

```php
class CustomArticleController extends WebsiteArticleController
{
public function indexAction(Request $request, ArticleInterface $object, $view, $pageNumber = 1)
{
return $this->renderArticle($request, $object, $view, $pageNumber, []);
}
}
```

### Cachelifetime request attribute changed

The `_cacheLifetime` attribute available in the request parameter of a article
Expand Down

0 comments on commit 296241b

Please sign in to comment.