Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Fix augmentable not resolved in transient values #10417

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

aerni
Copy link
Contributor

@aerni aerni commented Jul 9, 2024

PR #9636 introduced the concept of transient values that are only resolved once they are needed. This PR fixes an issue that would make it impossible to get the augmentable from the Value, as it is never resolved.

Consider this simple tag:

class Resolver extends Tags
{
    public function index()
    {
        dd($this->context->get('id'));
    }
}

This is the dump:

CleanShot 2024-07-09 at 10 00 27@2x

Getting the augmentable would return null:

class Resolver extends Tags
{
    public function index()
    {
        dd($this->context->get('id')->augmentable());
    }
}

So we need to resolve the value in the augmentable() method first to be able to get the augmentable entry:

CleanShot 2024-07-09 at 10 02 46@2x

@jasonvarga jasonvarga changed the title [5.x] Fix augmentable [5.x] Fix augmentable not resolved in transient values Jul 10, 2024
@jasonvarga jasonvarga merged commit 19c5f6f into statamic:5.x Jul 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants