nystudio107 / craft-typogrify

Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
https://nystudio107.com/
MIT License
70 stars 13 forks source link

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

Closed adrianjean closed 7 months ago

adrianjean commented 7 months ago

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

khalwat commented 7 months ago

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

    "default_escape" => true,

...in it?

khalwat commented 7 months ago

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

adrianjean commented 7 months ago

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

    "default_escape" => true,

...in it?

Yup!!

adrianjean commented 7 months ago

4.0.3 Fixed it — Thank you!!