Skip to content

Commit

Permalink
Ensure the cascade is using the correct site
Browse files Browse the repository at this point in the history
This relies on PR statamic/cms#10109
  • Loading branch information
aerni committed May 20, 2024
1 parent 487e5c8 commit f90adbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Http/Controllers/Web/SocialImagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Statamic\Contracts\Entries\Entry;
use Statamic\Exceptions\NotFoundHttpException;
use Statamic\Facades\Data;
use Statamic\Facades\Site;
use Statamic\Taxonomies\LocalizedTerm;
use Statamic\View\View;

Expand All @@ -36,6 +37,8 @@ public function show(string $theme, string $type, string $id): Response
// Prevent an infinite loop when an image is generated in the augment method of the SocialImageFieldtype.
$data->set('seo_generate_social_images', false);

Site::setCurrent($data->site()->handle());

$view = (new View)
->template($template)
->layout($model['layout'])
Expand Down

0 comments on commit f90adbf

Please sign in to comment.