Publisher is EE6 compatible, but it does not support the Fluid field. 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 generating large numbers of items in developer log.

Status Resolved
Add-on / Version Bloqs 4.12.5
Severity
EE Version 5.4.3

Boiler Room Digital

Jul 06, 2022

I’m finding that my developer log is rapidly being filled up with warnings that a particular tag pair is missing when rendering an entry. The error message says the entry ID # but then no ID is given. There were 34000+ entries in the log, which then significantly slowed the loading of the site down.

Example error message:
Attempting to render a block from entry #, but the template tag pair is missing. Add {lead_text}{/lead_text} to your content/event-index template to correct this error.

Have manually deleted them from the database now and the site now runs much faster.

It would be great if there were an option to disable logging, and if the entry ID in the message was correctly filled in.

I’m running Bloqs 4.12.5 on EE 5.4.3

#1

BoldMinded (Brian)

Jul 06, 2022

Thanks for making the ticket. This way it’s searchable for other customers.

The log only happens if if you’re logged into the site and can access the CP, and it won’t log the same messages twice. Both of these conditions were added in a more recent version go Bloqs, so my guess is you’re seeing a lot of old, repeated logs from a previous version of Bloqs.

That message is being displayed b/c there is an issue with your entry. It has data for a block that does not have a corresponding template tag for, which is a notable issue IMO, which is why I logged it. You can edit the entry(s) and delete the blocks, or add and empty {lead_text}{/lead_text} tag pair to your template.

There isn’t anything I can/will do to to stop further logging of these issues, b/c as mentioned, it’s a legit issue that should be fixed in the content or in your template. If you have that many entries containing content that you no longer want output on the front-end, I consider that a content issue, not a bug or issue with the add-on.

#2

Boiler Room Digital

Jul 07, 2022

Thanks, Brian - take your point about this not necessarily being a bug, and can see the improvements have been made in terms of only logging when logged in with CP access.

I assume it should be telling me which entry ID it is at least, though - at the moment it doesn’t, which would be helpful - that seems like a bug to me, and would help me out, though the fact that the template name is included is helpful.

Also, I’ve checked my code and I have included somewhere on each page my Bloqs “Partial” which contains tag pairs for all of these items which are generating errors.

I think the problem is that I also have elsewhere on the page a call to Channel Entries which is just checking for one block type - full width image, so that I can use that as the Twitter/Facebook image. So effectively there’s an extra use of the Bloqs field just for that, with the full Bloqs field displayed later on. So I get multiple log items for every page.

I guess I can add empty bloqs tags for all of these to prevent this from happening, but it would be nice if there was a way to turn off the logging to prevent me having to do this.

#3

Boiler Room Digital

Jul 07, 2022

Also, when I put in the empty tags, I then had to add the “Child tags” as well, or I got an error. This generated a PHP error, as well as a link to the old docs website (eebloqs.com) which no longer worked. Once I’ve added the empty tags and their child tags, it no longer generates logs.

Another solution which would work for me would be to be able to set my bloqs field tag pair to only show certain types of block, which would be neater (to my mind) than having to include all the empty block tags.

{page_content}
    {full_width_image}
     {if "{blocks:count:of:type}" == 1}
      {big_image}<meta property="twitter:image" content="{img:url}" />{/big_image}     
     {/if}
    {/full_width_image}
    {button}{bloqs:children}{/button}
    {text_block}{bloqs:children}{/text_block}
    {lead_text}{bloqs:children}{/lead_text}
    {pull_quote}{bloqs:children}{/pull_quote}
    {images}{bloqs:children}{/images}
    {concertina_section}{bloqs:children}{/concertina_section}
    {video}{bloqs:children}{/video}
    {person_profile}{bloqs:children}{/person_profile}
    {heading}{bloqs:children}{/heading}
    {lead_text}{bloqs:children}{/lead_text}
    {embed_code}{bloqs:children}{/embed_code}
   {/page_content}
#4

BoldMinded (Brian)

Jul 07, 2022

That is an interesting use case. I’m not a fan of doing this, but I’ve added this to the next release of Bloqs as a hidden config item. In TagController.php look for this around lines 660.

if (App::userData('can_access_cp')) {
                $this->EE->load->library('logger');
                $this->EE->logger->developer($message, true);
            }

and change it to this

if (App::userData('can_access_cp') && !bool_config_item('bloqs_disable_logging')) {
                $this->EE->load->library('logger');
                $this->EE->logger->developer($message, true);
            }

Then you can add this to your config.php file and it should disable the logging.

$config['bloqs_disable_logging'] = true;

Login to reply