Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Field collection tokens don't work with Recurly's account syncing, as field collection updates it's entity before we can check the original value. This means that the "original" data always contains our updated data.
It's super annoying, and I think it would be a huge amount of (fragile) work to really work around. Instead, this patch just gives sites the option to disable checking for field changes and always push updates.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2232797.8-force-updates.patch | 3 KB | deviantintegral |
#1 | 2232797.1-force-updates.patch | 3.5 KB | deviantintegral |
Comments
Comment #1
deviantintegral CreditAttribution: deviantintegral commentedComment #2
quicksketchI'd prefer not to add it to the module, this is a pretty big hack to accommodate for field collection. $entity->original is supposed to be the original before updating, and if it's not, it really needs to be fixed in field collection.
Comment #3
deviantintegral CreditAttribution: deviantintegral commentedIt's not $entity->original that's broken, but that field collections are a separate entity. When we look at the field in the user save hook, it's already been updated so entity_load() returns the updated field collection.
I originally took this approach as it also helped us with testing account sync. We could potentially look at field collection's revision ID in $entity->original to pull up the old revision, but I'm pretty sure that won't work for users (no revisions), which is probably what most are using for Recurly accounts.
So, any other ideas? It would be really good if we could support field collection given how common it is for user address and phone information.
Comment #4
quicksketchHm, okay back to active then. Maybe what we could do is assemble the list of "original" tokens in presave, store them somehow, then compare them against the new values in update? I'm not sure that would help because entities are probably saved sequentially, and the collections would still probably be saved before the parent entity's presave.
Comment #5
aburke626Comment #6
markdorisonComment #7
apotek CreditAttribution: apotek commentedThis patch no longer applies cleanly.
Comment #8
deviantintegral CreditAttribution: deviantintegral at Lullabot for TheaterMania.com, Inc. commentedHere is a straight reroll.
Comment #9
colanShould we tag this for D8 forward porting? Is it an issue with D8 Paragraphs? It would make sense to support that as FC is deprecated in favour of that.