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: Error when saving bloqs

Status Resolved
Add-on / Version Bloqs 4.8.0
Severity
EE Version 5.4.2

The Wire Inc.

Sep 01, 2021

EE 5.4.2 , PHP 7.4.22.

After upgrading Bloqs from 4.6.0 to 4.8.0 I receive the following error every time I need to edit and existing bloq or create a new one.

Fatal error: Uncaught TypeError: Argument 2 passed to BoldMinded\Bloqs\Database\Adapter::saveBlockComponent() must be of the type array, bool given, called in .../system/user/addons/bloqs/mcp.bloqs.php on line 802 and defined in .../system/user/addons/bloqs/Database/Adapter.php:1422

Stack trace: #0 .../system/user/addons/bloqs/mcp.bloqs.php(802): BoldMinded\Bloqs\Database\Adapter->saveBlockComponent(Object(BoldMinded\Bloqs\Model\BlockDefinition), false) #1 .../system/user/addons/bloqs/mcp.bloqs.php(530): Bloqs_mcp->saveBlockDefinition(Object(BoldMinded\Bloqs\Model\BlockDefinition)) #2 [internal function]: Bloqs_mcp->blockDefinition() #3 .../system/ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1684): call_user_func_array(Array, Arr in .../system/user/addons/bloqs/Database/Adapter.php on line 1422

I do not have Bloq Groups or Blog Templates define, only several bloqs. I had to revert back to Bloqs 4.6.0 for the time being. I do not have a staging environment but I can setup one if needed.

Any help is greatly appreciated.

#1

BoldMinded (Brian)

Hi there. Change line 802 of the mcp.bloqs.php file to this and see if it makes a difference

$this->adapter->saveBlockComponent($blockDefinition, ee()->input->post('field_id_0') ?: []);
#2

BoldMinded (Brian)

Is this how the bottom of your block definition settings page looks? Not sure how there is no valid $_POST[‘field_id_0’] value, which is what it is complaining about. If it’s rending the field as seen below then there shouldn’t be any errors (with the original code, not including my change in the previous comment)

https://www.dropbox.com/s/2c90onvm7p1p5pe/ticket-2316.png?dl=0

#3

The Wire Inc.

I upgraded again and made the code change you suggested. It works fine now.

I don’t see anything like your screenshot.

#4

BoldMinded (Brian)

Can you share what you do see at the bottom of the block definition page? If you don’t see that, then my inclination is it’s not loading all of the latest files. Not seeing those last 3 field options (the 2 toggles and the bloqs field) is kind of a big deal :D

#5

The Wire Inc.

Comment has been marked private.

#6

BoldMinded (Brian)

Comment has been marked private.

#7

BoldMinded (Brian)

Comment has been marked private.

#8

The Wire Inc.

That works and now I can see the Component Builder. Thank you for your help.

#9

BoldMinded (Brian)

Good to hear! 😊

Login to reply