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

Call to a member function getCallable() on null #86

Closed
adrianjean opened this issue Mar 27, 2024 · 4 comments
Closed

Call to a member function getCallable() on null #86

adrianjean opened this issue Mar 27, 2024 · 4 comments
Labels

Comments

@adrianjean
Copy link

adrianjean commented Mar 27, 2024

Describe the bug

After upgrading to 4.0.2 on CraftCMS 4.8.6 Pro I get the following error: Call to a member function getCallable() on null

Error:

Call to a member function getCallable() on null
1. in /srv/www/website.com/vendor/nystudio107/craft-typogrify/src/variables/TypogrifyVariable.phpat line 313
$text = '';
        }
        $text = (string)$text;
 
        $settings = Typogrify::$plugin->getSettings();
 
        if ($settings && $settings['default_escape'] === true) {
            $twig = Craft::$app->getView()->getTwig();
            $twig_escape_filter = $twig->getFilter('twig_escape_filter');
            $text = $twig_escape_filter->getCallable()($twig, $text);
        }
 
        return $text;
    }
}

Screenshots

If applicable, add screenshots to help explain your problem.

Versions

  • Plugin version: 4.0.2
  • Craft version: 4.8.6
  • PHP 8.3.4
@adrianjean adrianjean added the bug label Mar 27, 2024
@khalwat
Copy link
Contributor

khalwat commented Mar 27, 2024

I'm guessing your config/typogrify.php has:

    "default_escape" => true,

...in it?

khalwat added a commit that referenced this issue Mar 27, 2024
khalwat added a commit that referenced this issue Mar 27, 2024
khalwat added a commit that referenced this issue Mar 27, 2024
@khalwat
Copy link
Contributor

khalwat commented Mar 27, 2024

Addressed in the above commits. Released as 4.0.2 -> https://github.com/nystudio107/craft-typogrify/releases/tag/4.0.3

@khalwat khalwat closed this as completed Mar 27, 2024
@adrianjean
Copy link
Author

I'm guessing your config/typogrify.php has:

    "default_escape" => true,

...in it?

Yup!!

@adrianjean
Copy link
Author

4.0.3 Fixed it — Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants