Publisher is EE6 compatible, but it does not support the Fluid field.

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)

Sep 01, 2021

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)

Sep 01, 2021

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)

#3

The Wire Inc.

Sep 01, 2021

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)

Sep 01, 2021

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.

Sep 01, 2021

Comment has been marked private.

#6

BoldMinded (Brian)

Sep 01, 2021

Comment has been marked private.

#7

BoldMinded (Brian)

Sep 01, 2021

Comment has been marked private.

#8

The Wire Inc.

Sep 01, 2021

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

#9

BoldMinded (Brian)

Sep 01, 2021

Good to hear! 😊

Login to reply