-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to duplicate an unsaved element. #352
Comments
I am having a similar issue, I couldn't tell if it was Craft or Neo causing the problem. |
I've yet to reproduce the error, but I agree with the resolution from the Craft issue report that this is probably a Neo bug. Is the involved Super Table (or Matrix) field set to the same propagation method as the Neo field? |
I am having a similar issue when trying to save an entry with a Neo field, with matrix and supertable fields inside. The issue emerged when I added a supertable field, to an existing matrix block. The supertable first throws error for missing values in my frontend template, even when I have a test for null or empty, if i try to add the values in CP the "duplicate unsaved element" exception is thrown. The workaround with saving draft first, then publish seems to solve the problem, but I have to forcefully set values in all fields, then save. After I can remove the values and everything works fine. If I create a spanking new entry it will work from scratch with no errors or excetions. |
@BSBjorn, could you please let me know if your Craft installation is multi-site, and if so, what the propagation methods of the Neo, Matrix and Super Table fields are? I haven't been able to reproduce the error and I'm wondering if there is a certain combination that causes it. |
@ttempleton My site is NOT a multisite setup. Can you set propagation on a single site? |
Thanks, @BSBjorn, and no, there are no propagation method settings on the fields on a single site. I'll keep looking into it and figure out why this is happening. |
My Neo field was set to "Save blocks to other sites in the same site group" and I had multiple Super Tables with a mix of propagation methods ("Save blocks to other sites in the same site group" / "Save blocks to all sites the owner element is saved in"). I've updated all my Super Table fields to have the same propagation method as the Neo field and I still have the same error. |
@lucasvallenet If possible, could you please send your composer.json/lock and database backup to [email protected]? |
Thanks for sending the files, @lucasvallenet, unfortunately I still can't reproduce the issue though... Was there a particular section or entry where it was happening? |
This is also happening for me, and from what I can tell, it happens like this:
(And this is on a single-site instance of Craft. ) Stack trace below.
|
@chadwells, if possible, could you please send your composer.json/lock and database backup to [email protected]? If that is possible, could you please also let us know if it only happens with certain sections, or any section that uses the affected Neo field? |
The issue seems to have disappeared on my side aswell, i'll get back to you if it appears again |
I am seeing the same error SuperTableService.php(917). All plugins are up to date. yii\base\Exception: Attempting to duplicate an unsaved element. in /Users/eric/Sites/tjc/vendor/craftcms/cms/src/services/Elements.php:734 |
Could anyone who was experiencing this issue please confirm whether it still occurs with the latest versions of Craft (3.5.0), Neo (2.8.1) and Super Table (2.5.4)? If it is still occurring, could you please confirm that here, and also send your composer.json/lock and database backup to [email protected]? |
I just ran into a problem when trying to update Craft from 3.4.13 to 3.5.1 ... I'm having the same issue as the above, could it be the one holding back det update? `Performing update with Composer ... done Exit Code: 1(General error) Working directory: /Users/bjornkamfjord/Sites/www.norturaproff.no Output:Yii Migration Tool (based on Yii v2.0.36)
The SQL being executed was: ALTER TABLE Error Output:Exception 'craft\errors\MigrateException' with message 'An error occurred while migrating Craft CMS.' in /Users/bjornkamfjord/Sites/www.norturaproff.no/vendor/craftcms/cms/src/services/Updates.php:235 Stack trace: |
@BSBjorn, I don't think this issue is involved with that, but it looks like a problem involving the |
I'm experiencing this same issue on:
|
@GaryReckard, if possible, could you please send your composer.json/lock and database backup to [email protected]? If that is possible, could you please also let us know if it only happens with certain sections, or any section that uses the affected Neo field? |
Hi @ttempleton, I won't be able to share a db dump, sorry. I just did a quick test, and I can edit and save an entry in a section that does not have the Neo-with-supertable. |
Hi There. Just wanted to let you know I emailed a copy of our db and composer files to assist you in fixing this issue. One thing I failed to mention in the email is we are running PHP 7.3.21 |
Thanks @chadwells -- confirming that I can reproduce the error with your files. I'll keep looking into it and will update as soon as I've figured out why it's happening and how it can be fixed. |
This should now be fixed in Neo 2.8.8. I was able to reproduce this on my usual testing environment after seeing what was happening with @chadwells' database, and figured out this was happening when an otherwise-unmodified Neo block had a Super Table field added to it with either a minimum number of rows set or a static row, which will automatically create the row(s). Because the Neo block was otherwise unmodified, it was not being resaved, so the new Super Table rows were never being saved. Neo should now set such Neo blocks as modified, so the block, and therefore the new Super Table content, is saved. |
Can confirm fixed. Thank you! |
Description
I have a multi-site Craft setup and a main Neo field with multiple blocks (supertable, matrix, select, ...).
When I add any block and save the entry, I encounter the following error:
"Attempting to duplicate an unsaved element."
The error seemed the come from the supertable plugin, but I have the same issue with a matrix field.
The only work around I have for now is to Save as Draft before than Publish, but it's not the best for the end user.
Steps to reproduce
Other information
The text was updated successfully, but these errors were encountered: