cancel
Showing results for 
Search instead for 
Did you mean: 

Empty cms bloks in frontend after migrating from 2.2.3 to 2.4.1

SOLVED

Empty cms bloks in frontend after migrating from 2.2.3 to 2.4.1

 

Our site has within the home page, a series of cms blocks.

<p>{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="64"}}
{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="66"}}</p>
<p>{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="104"}}</p>

After migration, you see the blank home where the blocks should be.
We add log in vendor/magento/module-cms/Block/Widget/Block.php and when logging the block what we see is

$blockId Array
(
[type] => Magento\Cms\Block\Widget\Block
[+template] => widget/static_block/default.phtml
[+block_id] => 66
[store_id] => 2
[module_name] => Magento_Cms
)

In a native 2.4 magento, where if you see the blocks, that log shows

$blockId Array
(
[type] => Magento\Cms\Block\Widget\Block
[template] => widget/static_block/default.phtml
[block_id] => 20
[module_name] => Magento_Cms
)

What makes it not lift the block is the + that it adds forward, as if it detects that the block has something invalid and adds the +
We try to generate new blocks, and the same thing happens to us.

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Empty cms bloks in frontend after migrating from 2.2.3 to 2.4.1

We already found the problem, a previous provider had overwritten
\Magento\Widget\Model\Template\Filter;
And i was doing
$construction[2] = urlencode($construction[2]);
That generated a parameter with '+' characters, which when tokenize the keys were
['+block_id'], ['+template']

Regards,
Federico

View solution in original post

1 REPLY 1

Re: Empty cms bloks in frontend after migrating from 2.2.3 to 2.4.1

We already found the problem, a previous provider had overwritten
\Magento\Widget\Model\Template\Filter;
And i was doing
$construction[2] = urlencode($construction[2]);
That generated a parameter with '+' characters, which when tokenize the keys were
['+block_id'], ['+template']

Regards,
Federico