verbb / shortcodes

Craft CMS 3 shortcode plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work with plain text fields

daltonrooney opened this issue · comments

Hey there, love this plugin! Sometimes you just need a shortcode, haha. This is working exactly as expected when I add the shortcode to a rich text field, but I get an error when I try to use it in plain text fields. The error message is:

TypeError
Argument 1 passed to samhernandez\shortcodes\twigextensions\ShortcodesTwigExtension::shortcodesFilter() must be an instance of Twig\Markup, string given, called in /app/storage/runtime/compiled_templates/81/812f2d33030706fcd58a4f5d47f34d9de274c807d526fad02d38cd8362faa44e.php on line 58

If I update the shortcodesFilter() method to expect a string instead of a Twig\Markup object, everything works as expected:

public function shortcodesFilter(string $markup)

Thoughts?

@daltonrooney thanks for pointing this out. This was fixed in a previous commit but it looks like I goofed up the last release by not updating the version in composer.json. I just cut a new release so you can update the plugin.

Cheers