• Resolved Sa?a

    (@stodorovic)


    Hi,

    It’s great plugin. I just received a PHP notice related to Twig. I see in QM (Query Monitor) this:

    Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0

    By my research, it’s old “replace” in views/app/container.html.twig. If I change “replace” there with replace({' ': '-'}) then I don’t see PHP notice more. ( https://twig.sensiolabs.org/doc/2.x/filters/replace.html )

    • This topic was modified 7 years, 6 months ago by Sa?a.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Peter Featherstone

    (@peterfeatherstone-1)

    Hi there,

    You can ignore the deprecation notice as I have locked the Twig version due to them dropping support for PHP 5.5 in later versions and so wont be upgrading it. ??

    Hope that helps

    Peter

    Thread Starter Sa?a

    (@stodorovic)

    Hi Peter,

    I’m ignoring the deprecation notice (it’s on each page), but it’s boring (for developers) when more plugins trigger some notices. It’s easier to see mistakes in my code if other plugins don’t trigger notices.

    It’ll be nice if you update the code (in one of next releases), I already made simple PR (github) and you can see what I meant. ??

    It works in current version without notice (Twig) and it’ll work in newer versions.

    There are more “replaces” into views/admin/macros.html.twig, but it affects only plugin settings (I mean only one page). I’ll make PR (and I’ll do more tests) for it in next days. As I said, it’s great plugin and I want to give my minor contribution. ??

    Sasa

    Peter Featherstone

    (@peterfeatherstone-1)

    Hey Sasa,

    I very much appreciate that and I only meant ignore it for now as I was going go fix it for you for the next release.

    Thanks very much for the PR. Once all instances are covered I’ll merge it in ??

    Thanks again

    Peter

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twig template – Deprecated “replace”’ is closed to new replies.