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: After enabling nesting, the order of the bloqs seems to impact whether an error is thrown.

Status Resolved
Add-on / Version Bloqs 4.2.1
Severity
EE Version 5.3.0

Adam Skiles

Feb 26, 2020

Once I enabled nesting in my bloqs field, I started getting the following error.

An error occurred a nested Bloq field, probably because you forgot to add the {close:[block_name]}{/close:[block_name]} tag pair. Please refer to the documentation.

We talked briefly on Slack and you mentioned that I needed to add the close tag to all the bloqs, which I did, but still had the same issue, so I started messing around with the fields. If I put some field into ‘draft’ status, it would work, but when I brought them out of draft status it wouldn’t - it seemed very random. I checked the fields, and even with fields having the exact same settings - some would throw the error, some would not.

Through more testing, I think I finally tracked the issue down to not being so much as what is in the bloq field, or its settings, but where it is located. I can have a content field (Wygwam) second in the order and it will throw an error - but if I move that content field first in the list, the page will display fine.

#1

Adam Skiles

Comment has been marked private.

#2

Adam Skiles

Comment has been marked private.

#3

BoldMinded (Brian)

What is this?

{block_media_group_item}

        {close:block_content}{/close:block_content}
    {/block_content}

Shouldn’t it be?

{block_media_group_item}

        {close:block_media_group_item}{/close:block_media_group_item}
    {/block_media_group_item}
#4

Adam Skiles

Oops - that was just a bad copy/paste.

{page_block_content}

    {block_media_group}

        {close:block_media_group}{/close:block_media_group}
    {/block_media_group}

    {block_media_group_item}

        {close:block_media_group_item}{/close:block_media_group_item}
    {/block_media_group_item}

    {block_content}

        {close:block_content}{/close:block_content}
    {/block_content}

{/page_block_content}

Note: I have reduced the template to nothing but the code example provided in the field type and still have the same issue.

#5

Adam Skiles

Another interesting tidbit I just noticed while looking at the code…

I have 8 blocks in an order that is currently working in the following order…

  • content
  • counselor search
  • call to action
  • media group
    • media group item
    • media group item
    • media group item
    • media group item

The code is currently showing… - content - counselor search - call to action - media group - media group item - media group item - media group item - media group item - content (the surrounding code, but no actual content in it).

Even if I put the actual content block in draft status, I still get this showing up.

Is it possible that ‘page_block_content’ as the field name and ‘block_content’ as a bloq field are interfering with each other somehow?

#6

Adam Skiles

Disregard the last message. I am still having an issue, but that last bit was template related. Sorry!

#7

BoldMinded (Brian)

So this only happens, regardless of block order, when any block in the list is in draft state?

#8

Adam Skiles

I hadn’t made that connection - I thought it had to do with the nesting, but after testing, yes, I believe you are correct.

Nesting seems to work completely fine until I start putting bloqs into draft status, at which point, it may error the page out based off the order of the bloqs.

#9

BoldMinded (Brian)

Ok, cool. Thanks for confirming. That gives me something to focus in on, hopefully it’s an easy fix.

#10

Adam Skiles

One other thing to note that I just ran into on the live site. You don’t even have to have any bloqs nested. If the nesting option is simply turned on, and you throw a bloq into draft status, it can cause this error.

#11

BoldMinded (Brian)

Just an update on this. I’ve tried to replicate it, but I can’t. I’m going to create additional blocks in my local environment and give it another go today or tomorrow.

#12

BoldMinded (Brian)

Yeah, I still can’t replicate this. https://d.pr/i/JWWb8O

using the following template code

{bloqs}
    {slab}
    <div data-block-name="slab">
        {heading}
    {close:slab}
    </div>
    {/close:slab}
    {/slab}

    {section}
    <div data-block-name="section">
        {heading}
    {close:section}
    </div>
    {/close:section}
    {/section}

    {row}
    <div data-block-name="row">
        {heading}
    {close:row}
    </div>
    {/close:row}
    {/row}

{/bloqs}
#13

Adam Skiles

Hmm. Well that’s not what I wanted to hear. I’ll try and dig deeper and see if maybe it’s related to a specific field, third-party add-on, etc.

#14

Adam Skiles

I believe I may have tracked down the issue to incorrect siblings being returned. I modified line 289 in TreeHelper.php to only return siblings not in draft status (&& $block->isDraft() != TRUE) and the page stopped error out, and displayed.

I’m not a PHP guru by any means, so I can’t say if this will effect anything else or if the problem is actually somewhere else and this just inadvertently took care of it for this specific case.

#15

BoldMinded (Brian)

This has been resolved and will be included in the next Bloqs release (probably 4.2.3)

Login to reply