digitalpulsebe / craft-multi-translator

Translate Entry content using external services
Other
0 stars 1 forks source link

Overwrites all existing NEO blocks when translating #16

Closed lenvanessen closed 3 weeks ago

lenvanessen commented 1 month ago

If you share blocks between all sites, but only translate the fields within, this plug-in will break your site. It's not passing the original block ids to the field, so NEO will treat each translated block as a new block, removing alle existing blocks from all other pages an thus resulting in your latest translation being applied to all sites.

bartdigitalpulse commented 1 month ago

Hi @lenvanessen. Thanks for reporting this issue. We'll look at it as soon as possible.

lenvanessen commented 1 month ago

@bartdigitalpulse I opened a PR, after some debugging and testing this works well for our case here, we haven't tested matrix or other propagation methods, but it should work just fine.

There seem to have been some changes when craft optimized the saving of complex elements by tracking the delta's

JodebaDigitalPulse commented 3 weeks ago

Hi @lenvanessen,

indeed, it looks like something has been changed when upgrading Neo. But have you tried setting the propagation method of the Neo field to 'Save blocks to other sites with the same language'? Because this allows for each language/site version to have their own blocks.

If this helps, the PR won't be necessary. Your PR changes the behaviour of the other matrix types as well.

Let me know! Best regards,

lenvanessen commented 3 weeks ago

@JodebaDigitalPulse we don't want that propagation method for our site, as our blocks need to be propagated to all sites, regardless of language.

JodebaDigitalPulse commented 3 weeks ago

Hi @lenvanessen , you're right: this should have the same behaviour as editing the Entry in the CMS. Can you try updating to 2.7.0? I had to alter your suggested code a little bit, but thank you for suggestion! 🙂