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: Config setting to turn off “formsecret”

Status Resolved
Add-on / Version Bloqs 5.0.11
Severity
EE Version 7.3.11

Andrew Gunstone

Dec 08, 2023

Hey Brian,

I’ve run into an issue when running EE and Bloqs on a multi-instance environment (with AWS). We have multiple (normally 2, but it can auto-scale up if required) instances of the code running, with one database.

I’m finding that everything works really well with EE and most addons (including Publisher!), but very occassionally when saving an entry, all the Bloqs data ‘disappears’. This does not happen on my local (one server instance) version, and did not happen on our staging (one server instance).

I found that the bloq content is in the “exp_blocks_atom” table, but the link between the entry and the atoms is completely deleted from the “exp_blocks_block” table.

After a bit of investigating, I found that changing line 149 of system/user/addons/bloqs/Service/FormSecret.php from:

return $postSecret === $sessionSecret;

to always return ‘true’ fixes the issue ... so something like:

return true;

Now ... I don’t really know the implications of doing this. It all still seems to work fine, and we don’t lose the content.

My feature request would be to have a new config item that helps us get around this.  Maybe something like (the default would be false):

$config[‘bloqs_multi_server_instance’] = ‘true’;

And then in the FormSecret.php it simply switches between the two bits of code above.

Let me know what you think!

Cheers

Andrew.

#1

BoldMinded (Brian)

That function isn’t getting called. ft.bloqs.php ln 522

private function validateSecretKey(): bool
    {
        // Disabled, again MKTWEB-6312
        return true;

It’s always returning true.

I think what you’ve stumbled upon is an issue that has haunted me for years. The real issue is that for whatever reason when you save an entry on your server, the request is not completed. When Publisher is installed with Bloqs the only way to get it to work is to have Publisher intentionally delete all the existing blocks for an entry, and then they get re-saved. If the POST request is aborted for whatever reason and doesn’t finish, then it can exhibit the behavior you’re seeing. I don’t have a solution for this unfortunately.

#2

BoldMinded (Brian)

Do you have a load balancer in front of your servers?

#3

Andrew Gunstone

Ha. Well there goes my theory that I fixed the issue! I think it may just be a coincidence then that we haven’t had any issues for a few weeks! Doh!

To answer your question, yes, we have a load balancer in front of the server instances.

I will say that I’m (sort of) glad that you know about the issue, and I’m not going mad!

If you have any ideas, I’m happy to do some testing.

#4

BoldMinded (Brian)

Do you have any sort of request timeout set on the load balancer? E.g. if the servers behind the balancers don’t respond after 30 seconds the balancer returns an error?

Do you notice when this happens if the save request is slower than normal?

#5

BoldMinded (Brian)

Also, what version of Publisher?

#6

BoldMinded (Brian)

What other add-ons do you have installed?

Do you want to try this change? It delays the deletion of the old blocks until the very last moment before it creates the new ones, which in theory could fix it, but since I’ve never been able to replicate this locally and only seen it happen on one other site its kind of a shot in the dark. I did some testing with basic blocks, as well as blocks with a Relationship field and Assets field and they seemed to save fine each time.

#7

Andrew Gunstone

Comment has been marked private.

#8

BoldMinded (Brian)

Andrew, how has this change been working out for you in production so far?

#9

BoldMinded (Brian)

Andrew, since I haven’t heard anything I’m going to assume this fix has improved the situation, and I’m going to include it in the next Publisher release.

Login to reply