Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: PHP 8.1 deprecation error & solution

Status Resolved
Add-on / Version Bloqs 4.12.5
Severity
EE Version 6.3.4

David Clough

Jul 14, 2022

Hi I’ve just inherited a site from another developer, locally I run PHP 8.1 when I ran the site I was getting a depraction notification, so I fixed it, and thought I’d share the solution so you can add it back in (it’s a one liner)

line 926 of bloqs/Controller/TagController.php

      $closeContent = str_replace($blockVariableKeys, $blockVariableValues, $closeContent);

to

      $closeContent = $closeContent ? str_replace($blockVariableKeys, $blockVariableValues, $closeContent) : ‘’;

Seems to work fine so hopefully this is helpful.

Thanks

Dave

#1

BoldMinded (Brian)

Thanks for sharing David. That line of code and everything relating to it (the old {close:bloq} syntax) was entirely removed for the next release, so not sure I’ll need to patch anything.

#2

BoldMinded (Brian)

BTW if you’re seeing that error then you’re using old/deprecated code, e.g. you probably have instances of {close:bloq_name} {/close:bloq_name} in your templates. You should probably update that to use {bloqs:children} instead. https://docs.boldminded.com/bloqs/docs/features/nesting#template-tags

Login to reply