When I delete orders, I see the table commerce_option is cleaned but the table field_data_field_myoption is not .
should it not be cleaned as well ?
When I delete orders, I see the table commerce_option is cleaned but the table field_data_field_myoption is not .
should it not be cleaned as well ?
Comments
Comment #1
tajindersingh commentedThis appears to be resulting in PDOException: SQLSTATE[23000]
https://drupal.org/node/1475592
Comment #2
tajindersingh commentedUpdating priority as it makes impossible to let customer buy products in case it is the reason of products not getting added to cart as it results in PDOException:
https://drupal.org/node/1475592
Comment #3
kevinsiji commentedAt the moment it seems, only available option is, not to delete orders on a production website.
Comment #4
tajindersingh commentedIsn't there any way we can track the fields being used using records in commerce_option?
Usually it is required to delete all the orders and reset primary key for commerce_order table, before delivering the site for production use. So, it throws the Exception when customer first tries to purchase till the auto increment for line_item doesn't reach above already used in the field_data table.
Comment #5
anybodyThis is still a very important issue and doesn't seem to be fixed yet. Can we use the power of entities to delete the orphaned entries?
Comment #6
anybodyI think the solution is to hook into the line item delete process and delete the related options before?
Perhaps https://api.drupal.org/api/drupal/modules!system!system.api.php/function...
Comment #7
tajindersingh commentedSimilar issue was at https://drupal.org/node/1475592
and got solved by patch in #12 there.
The patch improved the code in same hook in commerce_option module.
Seems that will also this issue in case commerce_line_item delete is issued on order delete.
Comment #9
Anonymous (not verified) commentedThis issue is fixed in the latest dev. Field data should now be deleted if the owning commerce option entity is deleted.
Comment #10
peter caritas commentedHello,
I've downloaded the latest 7.x-1.x-dev and the fix referenced in #8 is not in there.
Comment #11
Anonymous (not verified) commentedThe fix is in the 2.x branch. Sort of messed up the commit message
Comment #12
egarbeil commentedI'm glad the fix is in the 2.x branch, but my client's site was installed in 1.x, and according to the documentation - there's no update path. This is a huge and ongoing problem. If you are not going to update 1.x branch, please provide an upgrade path to the 2.x branch. It's a production site and I can't experiment too much, so I need a clear path.
I have already applied the patches mentioned in the other issues, but the problem still occurs. I can't disable the delete orders, and it wouldn't matter because it happens when items are removed from the cart as well.
Comment #13
egarbeil commentedComment #14
solideogloria commentedComment #15
solideogloria commentedRe #12, if you look at #8, the fix was applied to both branches.
Comment #17
sano commentedI am running the Commerce Product Option version 7.x-1.0-beta2+35-dev (2015-Feb-05) and still see the problem.
...and regarding this statement:
...but the comment #11 by @samspinoy suggests, that the 7.x-1.0 dev version was not fixed.
Comment #18
solideogloria commentedIt was fixed. But the maintainer reverted basically everything.
"Revert files to state of before project takeover. All new development will be on 2.x"
https://git.drupalcode.org/project/commerce_option/-/commit/a7766c87862d...
So if you want the fix, get a version of dev before the maintainer reverted everything. You can use the 08 Nov, 2014 version of dev. And you may have to fix the 2015 issue #2417947: Commerce 7.x-1.11: Option values are not stored with a patch.
Comment #19
sano commentedI used the patch #11 from the related issue and the problem seems to be gone.