Skip to content

Commit

Permalink
Fix parsing of Antlers variables (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Jul 10, 2024
1 parent 581542a commit e574841
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"spatie/image": "^3.4",
"spatie/laravel-ray": "^1.32",
"spatie/schema-org": "^3.14",
"statamic/cms": "^5.3",
"statamic/cms": "^5.14",
"whitecube/lingua": "^1.1"
},
"require-dev": {
Expand Down
14 changes: 12 additions & 2 deletions src/View/AugmentedCascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ public function keys(): array
->unique()->sort()->values()->all();
}

protected function wrapValue($value, $handle)
protected function wrapDataMethodInvokable(string $method, string $handle)
{
return new Value(
$value,
fn () => $this->data->$method(),
$handle,
app(CascadeFieldtype::class), // Add a dummy fieldtype to enable Value objects to parse Antlers.
$this->data
);
}

protected function wrapDeferredValue($handle)
{
return new Value(
fn () => $this->getFromData($handle),
$handle,
app(CascadeFieldtype::class), // Add a dummy fieldtype to enable Value objects to parse Antlers.
$this->data
Expand Down

0 comments on commit e574841

Please sign in to comment.