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 are not saving in nested state
Status | Resolved |
Add-on / Version | Bloqs 4.6.0 |
Severity | |
EE Version | 6.0.3 |
Nigel
Mar 14, 2021When I nest bloqs that have been setup to accept children/parent it will un-nest when saved. The video below demonstrates this
https://www.icloud.com/iclouddrive/08i2flwMLGM4hpau1qY4za2sg#Un-nested-bloqs
I have also tried this with templates, again a video of this in action:
https://www.icloud.com/iclouddrive/09IoaBqRiFjQKeW2E2uCFli6Q#bloqs_unnested_2
Thank you
BoldMinded (Brian)
Mar 14, 2021
This too is also probably because of the max input vars issue. I bet if you save an entry with 3 nested Bloqs it saves fine, but an entry with a lot of Bloqs doesn’t save.
Nigel
Mar 15, 2021
So I have tried to create a fresh entry with only 3 blocks.
Two blocks nested under one. On save all blocks are un-nested.
I have also increased the max_input_vars to 5000. Still no joy!
https://www.icloud.com/iclouddrive/0MVfnLXd0sj_FGtJioq-BhoVw#Unnested-5000-vars
Nigel
Mar 15, 2021
The above video shows my attempt with a template. But I have also tried with plain single bloqs.
Nigel
Mar 15, 2021
To provide more information on what I am seeing, on First save only, does this un-nesting seem to happen.
BoldMinded (Brian)
Mar 15, 2021
Any JS errors in your console?
BoldMinded (Brian)
Mar 15, 2021
Are you 100% positive that field has nesting enabled? https://docs.boldminded.com/bloqs/docs/features/bloq-templates#bloq-templates-and-non-nested-fields
Nigel
Mar 15, 2021
No errors in the console. I had tried Safari and Chrome.
BoldMinded (Brian)
Mar 15, 2021
And what about the field setting? Is it set to nestable? Did you try this with normal bloqs? E.g. not a template?
https://docs.boldminded.com/bloqs/docs/features/bloq-templates#bloq-templates-and-non-nested-fields
Nigel
Mar 15, 2021
The field setting has always been set to nestable. I have tried with normal bloqs.
Video showing settings
https://www.icloud.com/iclouddrive/0MN6C9b378FopSIaMJXw8s_2w#unnested-show-settings
Nigel
Mar 15, 2021
I’m assuming you are seeing the videos I have made?
BoldMinded (Brian)
Mar 15, 2021
Comment has been marked private.
Nigel
Mar 15, 2021
Thanks. No joy. The un-nesting.
It appears I that on first save, it will wipe all but two bloqs and any data I had inputted!
I uninstalled the plugin and re-installed it. So working with fresh bloqs.
I have my bloq field that has nesting enabled.
I have a grid wrap bloq that can accept children
I get a bloqs save error:
BoldMinded (Brian)
Mar 15, 2021
Are you sure the uninstall completely removed the blocks tables? Based on that error message the uninstall wasn’t performed correctly, or you saved an entry and it inserted data, and then somehow re-saving it is trying to update the data but is failing to do so.
What version of MySQL are you using?
Can you run this query and share the result:
The last build I sent is saving nested bloqs in a template, and not in a template just fine in my local environment. Since I can’t replicate this, you’ll need to share CP and FTP access to a dev environment where this is happening so I can take a look.
Nigel
Mar 16, 2021
Comment has been marked private.
BoldMinded (Brian)
Mar 16, 2021
Can you provide CP and FTP access, and point me to the entry that is throwing this error when you attempt to save it? Does this error happen when saving any entry or just a specific one?
BoldMinded (Brian)
Mar 16, 2021
My guess is that is not happening on every entry, so you might have to delete the bloqs in the entry that the error is occurring in and re-create them. The data column correctly does not allow NULL as a value, but if the field does not have a value, it should be set to a blank string in the database, which is allowed. If that error is repeatedly happening, then something is incorrectly trying to set that field value to NULL, which it should not be doing. I just did a clean install of Bloqs locally and created a Bloq Template and it’s saving everything fine, including fields with no values. So if you’re still seeing that error, then I need CP and FTP access before I can take any further action.
Nigel
Mar 16, 2021
Comment has been marked private.
BoldMinded (Brian)
Mar 16, 2021
Can you edit the ticket and use the provided fields for fro info? Having it in a comment is less secure. I’m going to edit your comment and remove the info.
Nigel
Mar 17, 2021
Info updated.
Nigel
Mar 17, 2021
I tried to push forward as Im on a deadline. But I can also see that relationship bloqs are not saving with the selected relationship data. But I assume this is related to the error message.
BoldMinded (Brian)
Mar 17, 2021
Please direct me to a specific entry id where’re I can see this happen. Do specific Bloqs need to be on the page? I need steps to replicate. Thanks.
Nigel
Mar 17, 2021
When I copied over your new build I had re-installed it first. I assumed that there may be new bits that needs to be installed.
The channels that I am using with bloqs are pages and sectors.
If I:
- Add “Grid Wrapper” and nest “Ideas Image Block” under it.
- Add a related collection
- Add Image
On save:
- The error appears
- The blocks are un-nested
- The data is not saved
This is on every new entry I have tried the error appears.
Nigel
Mar 17, 2021
Comment has been marked private.
BoldMinded (Brian)
Mar 17, 2021
Can you make that user admin access so I can look at the database, logs etc?
Nigel
Mar 17, 2021
Should be there now.
BoldMinded (Brian)
Mar 17, 2021
The FTP login didn’t work.
Can you either fix that, or update line 927 of the Database/Adapter.php file to this:
Looks like your MySQL engine is set to strict mode, which hasn’t really been a problem in the past so I’m surprised this error is just now occurring. If that code change doesn’t fix it, then I’ll definitely need the FTP access fixed so I can debug it a little closer.
BoldMinded (Brian)
Mar 17, 2021
Actually your MySQL strict mode setting is the same as my local machine. The issue appears to be specific to saving a bloq with a Relationship field in it. Other fields seem fine. Still, this isn’t reported by anyone else and I can’t replicate it locally, so this is s little puzzling.
BoldMinded (Brian)
Mar 17, 2021
Ok, I was able to replicate this locally actually, and it does seem specific to the Relationship field. I wonder if something changed in EE 6.0.2 or .3 to cause this, because this has not been an issue before. The code change in comment 26 is what fixed it for me. So you _should_ be good to go when you make that change.
Nigel
Mar 17, 2021
Hey thanks. I have added the line. You are right the code change stops the error.
However I still experience the un-nesting on save.
Adding new bloqs and duplicating nested bloqs
https://prototype.aguafabrics.com/admin.php?/cp/publish/edit/entry/781
I have updated the ftp settings. Username and Password.
BoldMinded (Brian)
Mar 17, 2021
Ok, I think I fixed it. Not sure how this regression happened b/c I’m pretty sure I tested this thoroughly. Oh well. In the cp.js file, line 216, change it to this:
Then it should work.
Nigel
Mar 17, 2021
I get your pain.
No joy with that either :/
I have replaced that line. Doubled checked by loading up EE Admin in a Chrome Incognito browser and viewing the cp.js file in the Network tab. Ln 216 has:
BoldMinded (Brian)
Mar 17, 2021
Comment has been marked private.
Nigel
Mar 17, 2021
So that seems to have done it :D
Thanks for your help with this.
Nigel
Jul 08, 2021
So I have had this project go live with content editors. Unfortunately, the un-nesting on save is still an issue. As you can imagine this is undermines the clients experience, so I am very keen to find a solution for this issue.
I have tried updating to the latest version of 4.7.1
I am running EE 6.0.6
I have run back through the thread to ensure I have applied the max_input_vars
One thing I have noted is, the un-nesting on save appears to only happen when a nested block contains a image/file field.
It seems we are closer to perfection. Really appreciate your help with this.
Thanks
BoldMinded (Brian)
Jul 08, 2021
Do the blocks that are un-nesting have a File field in them by chance?
Nigel
Jul 09, 2021
Yes. Yes they do.
I tested a block with just the image field inside it and that is always un-nested.
BoldMinded (Brian)
Jul 09, 2021
I ran into this just this week when working on a refactor. It was a pain to chase down, but the fix is easy. I’ll send a new build later today.
BoldMinded (Brian)
Jul 09, 2021
Comment has been marked private.
Wardour
Jul 10, 2021
Comment has been marked private.
BoldMinded (Brian)
Jul 10, 2021
I might have sent the wrong build. I’ll send another one on Monday.
BoldMinded (Brian)
Jul 11, 2021
Ok, you might need to make the update yourself. It’s an easy fix. Revert your Bloqs folder to the previous version you had, disregard that new build I sent, and make this change to the version you were running.