Skip to content

Commit

Permalink
Fix more data fetching following Statamic 3.3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewHaine committed May 24, 2022
1 parent 89a1c7a commit ee1049c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Parsers/PageDataParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public static function getData($ctx)
*/
public static function getDefaults($ctx)
{
$type = $ctx->get('is_term') ? 'taxonomies' : 'collections';
$is_term = $ctx->get('is_term')?->value();
$type = $is_term ? 'taxonomies' : 'collections';

switch ($type) {
case 'taxonomies':
Expand Down
6 changes: 4 additions & 2 deletions src/Tags/AardvarkSeoTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ public function hreflang()
{
$ctx = collect($this->context);

if (!$ctx->get('id')) {
$id = $ctx->get('id')?->value();

if (empty($id)) {
return null;
}

$data = Entry::find($ctx->get('id'));
$data = Entry::find($id);

if (!$data) {
return null;
Expand Down

0 comments on commit ee1049c

Please sign in to comment.