-
Notifications
You must be signed in to change notification settings - Fork 157
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
Duplication of post meta keys #258
Comments
Likely related to 1.3.4 - we tried to handle a situation where the same meta key is used multiple times on the source side (intentionally - WordPress supports that use case) - and it seems likely that this is unintended side effect with WooCommerce. We'll look into, but in the mean time, you can always roll back to 1.3.3 via Github. |
@arsendovlatyan Looking into this - when you say "with every update", what kind of update are you talking about? |
@helen Just regular post update, from admin interface, in source/original website. |
Quick clarification - we only see the empty "_test_meta" field being duplicated in your example; all the other fields seem fine. Can you confirm that all or some other fields are also duplicating? Is it just empty key values? |
Yes, I can confirm that only empty (or NULL) meta values will be duplicated. |
refactoring of set_meta function
Please consider my pull request, since it will solve another issue as well - distribution of serialized meta values, currently it's not working. I have tested many different cases, and seems like everything works fine. The only thing that i have noticed, is when you have 2 or more meta values, with the same keys and one of them is empty ('' or 0), in that case, all meta values in distention will eventually be reset to empty. |
refactoring of set_meta function
Commented on the PR about this too but also want to summarize here:
I think this is the same cause as what I saw in testing #259, which is that all those duplicated meta keys get set to the same value because of the way |
* fix of meta duplication, when meta value is empty or null #258 refactoring of set_meta function * fix of meta duplication, when meta value is empty or null #258 refactoring of set_meta function * fix undefined variable notice. * PHPCS and other formatting fixes * Don't store the response of `update_post_meta()` (yet) We should definitely report back any errors in storing meta; however we need to do it for both update and add and it needs to store into an identifiable array since it's inside a loop. Let's pick that up for 1.4 for sure. * Cast `$meta_values` to an array first Older versions of Distributor might not return an array for everything, this doesn't guarantee back-compat but at least it shouldn't explode anymore.
I was testing Distributor with Woo-commerce (using external connection) and all of the sudden noticed that meta keys getting duplicated in destination, with every update i have more and more duplicated meta keys.
I'm not sure if this is related to 1.3.4 release or #200 , but couldn't find similar bug-report and want to make sure that you are aware about it.
P.C. i have used fresh WordPress install (4.9.8) with fresh WooCommerce (3.5.1) and last version of Distributor 1.3.4
@helen @dkotter want to make sure that you are aware about this issue, we are not using Distributor in production yet, but if other do, it can add a mess in post meta table.
@madmax3365 to follow
The text was updated successfully, but these errors were encountered: