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 error on PHP 8.1

Status Resolved
Add-on / Version Bloqs 5.0.6
Severity
EE Version 6.4.6

Boiler Room Digital

Mar 15, 2023

Hello. When I run this on PHP 8.1.3 I see the following error:

Deprecated
json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
user/addons/bloqs/Database/Adapter.php, line 180

Severity: E_DEPRECATED

I assume that an update may resolve this soon, but wanted to check with you.

Thanks

Paul

#1

BoldMinded (Brian)

Comment has been marked private.

#2

Boiler Room Digital

Thanks - it appears to resolve the PHP issue on 8.1. I still have issues with some other Addons (Structure) so I can’t use 8.1 at this point in production, but this resolves the Bloqs issue. Thanks for the fast response.

#3

BoldMinded (Brian)

Good to hear 😊

#4

Boiler Room Digital

Hi again - just to say I’ve rolled back to the production version. I’m stuck on PHP 8 anyway, and the development version you sent actually caused a different issue for me. I have a Bloq that should return image file names, which it does in the production version, but in the development version you sent me, for one block at least, it returns nothing, which generates a PHP error which is a showstopper (on a resize plugin, which then doesn’t get a file name to resize). So I’m happy to stick with the production version for now, but wanted to flag up that there looks like an issue in the development version.

Thanks

#5

BoldMinded (Brian)

Can you please share some more information? I don’t know what you’re referring to with php file names. This in the front-end? Backend? Screenshots and any relevant code samples would help. Thanks.

#6

Boiler Room Digital

Here’s my Image block code:

{images}
  {sn_open_container}
  <div class="block block-images">
   {if image_3 && image_2}
    <div class="three-images">
     <div>{exp:resizer:tag 
       src="{image_1}" 
       width="800" 
       crop="yes" 
       alt=""
       quality="90"
       sharpen="yes"
       responsive="yes"
       attr:alt=""
      }
     </div>
     <div>{exp:resizer:tag 
       src="{image_2}" 
       width="800" 
       crop="yes" 
       alt=""
       quality="90"
       sharpen="yes"
       responsive="yes"
       attr:alt=""
      }</div>
     <div>{exp:resizer:tag 
       src="{image_3}" 
       width="800" 
       crop="yes" 
       alt=""
       quality="90"
       sharpen="yes"
       responsive="yes"
       attr:alt=""
      }</div>
    </div>
   {if:elseif image_2}
    <div class="two-images">
     <div>{exp:resizer:tag 
       src="{image_1}" 
       width="1000" 
       crop="yes" 
       alt=""
       quality="90"
       sharpen="yes"
       responsive="yes"
       attr:alt=""
      }</div>
     <div>{exp:resizer:tag 
       src="{image_2}" 
       width="1000" 
       crop="yes" 
       alt=""
       quality="90"
       sharpen="yes"
       responsive="yes"
       attr:alt=""
      }
     </div>
    </div>
   {if:else}
    <div class="single-image">
     <div>{exp:resizer:tag 
       src="{image_1}" 
       width="2000" 
       crop="yes" 
       alt=""
       quality="90"
       sharpen="yes"
       responsive="yes"
       attr:alt=""
      }</div>
    </div> 
   {/if}
  </div>
  {sn_close_container}
 {/images}

This works fine on the production version of Bloqs (5.0.6) but on the dev version you supplied to fix a PHP issue, the {image_1} {image_2} and {image_3} tags don’t contain a filename. So the conditional evaluates to “true” but {image_1} etc is blank. Normally this would just not display anything, but resizer then throws a PHP error because it cannot find the file.

The bloq config consists of 3 file fields, and a select dropdown for a class on the wrapper. Hope some of that is helpful.

#7

BoldMinded (Brian)

Can you share screenshots of the block configuration?

#8

Boiler Room Digital

Sure thing: https://www.icloud.com/iclouddrive/0ccZ6VXP7GTAhiiXa7LNnsWuA#Screenshot_2023-03-17_at_17.53

#9

BoldMinded (Brian)

Have you tried using the :url modifier? {image_1:url}

I can’t think of anything that has changed in Bloqs recently that would affect how an image field renders. In fact it should behave exactly like a Grid field. I don’t see anything in my Git log specific to images or any changes to the parsing lately.

What was the previous version you had installed before you updated to 5.0.6?

#10

Boiler Room Digital

Hello. I think previously we were on 4.12.5. I’ve not tried using that modifier. I’ll have to leave it for now unfortunately - since I’m stuck on 8.0, I’ll have to look again if I’m able to update all my addons for 8.1 compatibility at a later date, particularly if required by my hosts. Thanks for a great add-on.

Login to reply