Closed BrandonJamesBorders closed 7 years ago
Hmm. Bummer, I would think it would. I'll put it on my list to check out.
Out of curiosity - do other element fields (Entries, Users, etc) sync, or is it specifically Assets?
Yup, every other field I've tested is syncing correctly.
I'm hoping to dive into it more this week as well and will be sure to share any findings.
@timkelty I've come up with a solution but would appreciate your feedback before I implement it into a live site.
In the LocaleSyncService.php file I added the following code to the updateElement function between line 125 and 126.
if ($field instanceof Fieldmodel) {
if($field->type == 'Assets') {
craft()->relations->saveRelations($field, $element, $this->_element->content->$fieldHandle);
}
}
I came to this conclusion as the craft saveContent function does not handle relationships (as far as I can tell).
Of what you know about craft, do you see any pitfalls about implementing this code?
Thanks!
Taking a look this morning, thanks for your patience.
The problem with your solution the $matches
comparison, as at that point you'd be comparing two BaseElementModel
instances.
I just pushed a new version 1.5.0
, which adds support to sync ALL elements fields (Entries, Categories, Assets). Give it a shot, it should work for you.
@timkelty that update has worked. Thanks for the improvement!
Still getting a notice in the admin that the plugin has an update.
@BrandonJamesBorders ah, shoot.
Upgrade to 1.5.1 and that should be taken care of.
Not sure if this is a bug or simply not a feature, but Assets don't sync. Is there a solution for this?
Thanks!