All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

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: Bloqs does not render in live preview

Status Resolved
Add-on / Version Bloqs 5.0.5
Severity
EE Version 7.2.8

Pedro Guimaraes

Jan 31, 2023

After EE upgrade and Bloqs upgrade, bloqs no longer renders in live preview. I created a simple template and tested it by visiting the same URL live preview uses and it works. However in live preview the bloqs tags do not return anything.

#1

BoldMinded (Brian)

Comment has been marked private.

#2

Pedro Guimaraes

No custom hacks. I thought maybe it’s the WYGWAM field in the bloq, but I just tried an image and while it’ll render if I load the template, it’ll not in live preview. I could Control Panel access but it’s a dev server so I’d need to whitelist your IP…

#3

BoldMinded (Brian)

Have you tried it with basic text fields in the blocks only?

#4

Pedro Guimaraes

Yeah, I just created a text input field, added the word ‘bare’ and it loads in the template, but not live preview :(

#5

BoldMinded (Brian)

There is something else going on then since it’s working for me but not you. Have you tried to replicate this in a clean/new EE environment with only Bloqs installed?

#6

Pedro Guimaraes

I can. But I think instead I can just uninstall all add ons but bloqs and try?

If it’s an issue with my legacy bloqs fields, a fresh install isn’t going to help since this is an upgrade…

#7

BoldMinded (Brian)

Shouldn’t matter how old the field is. I need to rule out any potential conflicts or environment specific issues before I spend more time investigating on my end. If you can show in a fresh EE install that the preview works, then it means it’s something specific to your current environment. If it does not work in a new EE install, then there is a potential bug somewhere else that I can look into.

#8

Pedro Guimaraes

So I did a fresh install, same issue with a simple bloq field with nothing but a text input in the bloq.

#9

BoldMinded (Brian)

And you used the build I linked earlier in the ticket?

Can you share your template code?

#10

Pedro Guimaraes

No, I have the latest installed. The one you sent is 4.0.6, correct?

#11

BoldMinded (Brian)

Sorry, It’s supposed to be 5.0.6, not 4.0.6. It’s still the latest code I just typed the wrong number. Hold on for another build.

#12

BoldMinded (Brian)

Comment has been marked private.

#13

Pedro Guimaraes

Still didn’t work for me :/ I can turn off the firewall if you wanna take a quick look? I have a channel called test with one entry and it doesn’t work in live preview…

#14

BoldMinded (Brian)

Do you have Bloqs caching turned on? https://docs.boldminded.com/bloqs/docs/features/caching

If you want to provide FTP and CP access I can take a look, but it could be a few days. My IP will be in the next comment.

#15

BoldMinded (Brian)

Comment has been marked private.

#16

Pedro Guimaraes

Comment has been marked private.

#17

BoldMinded (Brian)

Can you edit the ticket and use the provided fields for the login creds? It gets deleted when the ticket is closed and I’d rather not have it linger in the comment field forever.

#18

Pedro Guimaraes

I just did…

#19

BoldMinded (Brian)

The CP isn’t loading for me, browser just spins.

#20

Pedro Guimaraes

Ok. I disabled the firewall… That should do it.

#21

BoldMinded (Brian)

Ok, I found out why we were seeing different results. The preview isn’t working when the field is not set to Nestable. As soon as I set it to Nestable, it rendered in the live preview.

I’ll work on this locally and get back to you when I can.

#22

Pedro Guimaraes

No rush! Glad you found the bug 😊

#23

BoldMinded (Brian)

I can send a whole new build, or this might be easier. In the Database/Adapter.php file line 271 you’ll see this:

$currentBlock
                ->setId($i)
                ->setOriginalBlockName($blockName)
                ->setOrder($i)
                ->setDefinition($blockDefinition)
                ->setComponentDefinitionId($blockData['componentDefinitionId'] ?? 0)
                ->setCloneable($blockData['cloneable'] ?? 0)
            ;

Change it to this

$currentBlock
                ->setId($i)
                ->setOriginalBlockName($blockName)
                ->setOrder($i)
                ->setDefinition($blockDefinition)
                ->setComponentDefinitionId($blockData['componentDefinitionId'] ?? 0)
                ->setCloneable($blockData['cloneable'] ?? 0)
                ->setDepth(0)
                ->setParentId(0)
                ->setLft(0)
                ->setRgt(0)
            ;
#24

BoldMinded (Brian)

I’m pretty sure my code change in the previous comment resolves the issue and it’ll be included in the next Bloqs release.

I’m going to close this out.

Login to reply