Skip to content

Commit

Permalink
Fix getPageContent creating additional session
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotls committed Nov 30, 2020
1 parent c07d986 commit 695ea50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SeoObjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function getSEOSocialLocale()
* Attempt to find a suitable social image to use if one is not set.
* By default try to see if this is a blog post and add the "Featured Image"
*
* @return Image
* @return Image
*/
public function getSEOPreferedSocialImage()
{
Expand Down Expand Up @@ -808,7 +808,11 @@ public function getNumCharsTitle() {
*/
public function getPageContent()
{
$response = Director::test($this->owner->Link());
$session = [];
if (Controller::has_curr()) {
$session = Controller::curr()->getRequest()->getSession();
}
$response = Director::test($this->owner->Link(), [], $session);

if (!$response->isError()) {
return $response->getBody();
Expand Down

0 comments on commit 695ea50

Please sign in to comment.