PrestaSafe / prettyblocks

Page builder open for source for PrestaShop
Academic Free License v3.0
75 stars 35 forks source link

Error 500 when saving banner image #186

Closed PubliAlex closed 9 months ago

PubliAlex commented 9 months ago

Hello,

I like the concept of this module, however, I encoutered a bug when saving banner image, here is the log :

image

This bug occurs when I press the save button after trying to add a banner as a block (classicblocks)

Best regards,

Alex

OctaYann commented 9 months ago

Same here saving non repeater fields to db, repeater data are saved.

`

Whoops, looks like something went wrong.

(1/1) ContextErrorExceptionWarning: array_merge(): Expected parameter 1 to be an array, null given -- in PrettyBlocksModel.php line 404 at PrettyBlocksModel->updateConfig(array('text' => array('type' => 'editor', 'label' => 'Text HTML', 'default' => '

Hello world

', 'force_default_value' => true, 'value' => '

Hello world

'), 'templates' => array('default' => 'module:classicblocks/views/templates/blocks/ps_customtext.tpl'), 'templateSelected' => 'default', 'default' => array('container' => true, 'load_ajax' => false, 'bg_color' => '')))in ajax.php line 374 at PrettyBlocksAjaxModuleFrontController->displayAjaxupdateBlockConfig()in Controller.php line 321 at ControllerCore->run()in Dispatcher.php line 525 at DispatcherCore->dispatch()in index.php line 28

`

OctaYann commented 9 months ago

$existingConfig = json_decode($this->config, true) ?? []; $newConfig = json_decode($this->generateJsonConfig(), true) ?? []; in modules\prettyblocks\classes\PrettyBlocksModel.php is working for me right now

PrestaSafe commented 9 months ago

Hi thanks for this report, can you make a pull request of your issue ?

PubliAlex commented 9 months ago

$existingConfig = json_decode($this->config, true) ?? []; $newConfig = json_decode($this->generateJsonConfig(), true) ?? []; in modules\prettyblocks\classes\PrettyBlocksModel.php is working for me right now

Problem fixed, thank you

PubliAlex commented 9 months ago

@PrestaSafe PR Created #187

OctaYann commented 9 months ago

Thank you @PubliAlex

PrestaSafe commented 9 months ago

It's merged thanks to you