Skip to content

Commit

Permalink
Merge pull request #41 from elliotls/master
Browse files Browse the repository at this point in the history
Fix getPageContent creating additional session
  • Loading branch information
hubertusanton authored Dec 1, 2020
2 parents c07d986 + 695ea50 commit c4bb806
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 c4bb806

Please sign in to comment.