tractorcow-farm / silverstripe-fluent

Multi-language translate module for Silverstripe, without having to manage separate site trees.
BSD 3-Clause "New" or "Revised" License
94 stars 111 forks source link

Implement onAfterDuplicate #804

Closed RVXD closed 1 year ago

RVXD commented 1 year ago

onAfterDuplicate method is now overwritten in FluentVersionedExtension.

tractorcow commented 1 year ago

Looks good to me! Are you happy for this to be merged, or still working on it?

RVXD commented 1 year ago

The challenge was that for each translation to work you need a corresponding version of the versioned base record. This is now solved by copying all versions of the base record. The version numbers in the versioned tables need to be matching in all tables. It is probably better to only copy the needed version records of the base record. But we couldn't get that to work for now. Maybe in an updated version. I believe this works. Tested it on multiple versioned and unversioned records and pages in the CMS. For now I think this is okay.