Closed angeldevz closed 5 years ago
I too am having this issue. Is it currently not possible with matrix fields?
It currently doesn't but should after a PR merge https://github.com/timkelty/craft-localesync/pull/9
Should get that merged in shortly
Just tried @superwick PR from https://github.com/timkelty/craft-localesync/pull/9 didn't work for me unfortunately.
@lexbi do you have the matrix field flagged as translatable? (as well as whatever fields within your matrix)?
Yes, both the matrix field & the matrix fields within it.
Weird. @superwick and idea?
I'm sorry, I got really confused with 2 separate PRs :)
The PR for matrix support was here: https://github.com/timkelty/craft-localesync/pull/6 and was already merged in with version 1.3.
So if you're on 1.3 and it isn't working, we'll have to see why. @lexbi Can you turn on devMode and see if any errors are logged?
I certainly can, though I just want to check my settings are right, can you confirm, I'm a bit uncertain what's right?
I want all the locales to take the British version, here are my settings:
How do I force a sync? I have tried re-saving an entry, but it doesn't apply anything to the other locales.
Here is a completely fresh log file of trying to save a completely new entry with the slug of trans-6
craft.log.zip using the settings above.
Let me know if I've done anything wrong here.
@lexbi Seems ok to me. In this case saving a US English entry should sync to British if the content is identical. Are things syncing ok for you with non-matrix fields?
To force a sync (if the content isn't identical), you'd want to make sure the "overwrite" option is enabled.
Hmm maybe I was expecting it to work in a way which it isn't yet setup for?
It appears that the sync does in fact work, but, only on a non translatable matrix & translatable fields within it. This is the only way that Craft is able to do this at the moment (on first save).
@lexbi Gotcha. Sounds like I'll have to do more testing with Matrix fields.
Matrix was originally excluded as there wasn't a good way to compare if the content was identical or not. The feature was merged in, but it appears maybe a bit prematurely.
I'll have to do some more testing, it gets confusing really fast :)
Here are the cases we need to decide what happens:
Let me know what you think.
I'm leaning towards the simpler approach where if a matrix field is translatable, syncing will occur for that entire field and it's blocks (if fields are identical or overwrite is on). Anything else gets very complicated to explain or expect what would happen.
Perhaps @erktime or @superwick would like to chime in, I believe they've been using matrix syncing in the wild more than I.
I think if you are wanting to sync the data, you need to cover all those options.
This is done in the Craft 3 version: https://github.com/timkelty/craft-site-sync/tree/2.0.0
How do we enable sync on matrix?