Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluent/Elemental: all translations but the last one saved are marked as modified #913

Open
2 tasks done
wernerkrauss opened this issue Dec 11, 2024 · 0 comments
Open
2 tasks done

Comments

@wernerkrauss
Copy link
Contributor

Module version(s) affected

5.2, 5.3

Description

When working with Elemental and BaseElement has FluentVersionedExtension applied, all translations of a block but the one saved last are marked as "Modified". That's cause Versioned::isLiveVersion() doesn't know about Fluent and having different Versions per Locale.

How to reproduce

  • Create a project with Fluent and Elemental;
  • Apply FluentVersionedExtension to BaseElement
  • Create a bunch of locales
  • Save a block and translate it to different Locales; publish the block in each locale.

Possible Solution

A possible solution would be to overwrite isLiveVersion() in FluentVersionedExtension:

    /**
     * Fixes a bug in Elemental/Fluent, where all translations but the last one saved are marked as modified,
     * cause Fluent saves a new Version per locale.
     * @return bool
     */
    public function isLiveVersion()
    {
        return !$this->getOwner()->stagesDifferInLocale();
    }

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant