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

Add check for ContentVariation.Nothing when copying documents. #15185

Merged

Conversation

nagolucky18
Copy link
Contributor

A new check for ContentVariation.Nothing is necessary when copying from documents to ensure that if there is no content variation as defined by the Nothing property, values are still copied even if variation is not supported since the content itself will not vary.

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes 14687

Description

Changes made:

  • Added additional check when copying. If the ContentVariation for a property is "Nothing" then regardless of whether variation is supported or not, the content of the property will not vary by culture so copying can continue.

Steps to Test

  1. Create document type "Home"
  2. Add a text field "Title".
  3. Enable "Allow as root"
  4. Enable "Allow vary by culture". Ensure Title is still not varied by culture.
  5. Save and close
  6. In settings, configure a second language. Keep the default (en-us). This step is important. If I later delete the second language, rollbacks work as expected.
  7. Create a page using the Home document type.
  8. Save and publish once with the Title as "test1"
  9. Save and publish again with the Title as "test2"
  10. Rollback to the test1 version
  11. Notice that the title says "test1" as expected.

(copied from original issue 14687)

Additionally, the following can be tested to ensure that the rollback behaves as expected.

  1. Repeat steps 7-9 with "Allow vary by culture" enabled for both the document type and text field.
  2. Repeat steps 7-9 with "Allow vary by culture" disabled for the document type.

A new check for ContentVariation.Nothing is necessary when copying from
documents to ensure that if there is no content variation as defined by
the Nothing property, values are still copied even if variation is not
supported since the content itself will not vary.
Copy link

github-actions bot commented Nov 12, 2023

Hi there @nagolucky18, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@busrasengul
Copy link
Contributor

Thank you @nagolucky18
I can see why this would be useful! Someone from the team will look into your PR soon :)

@georgebid georgebid self-assigned this Mar 25, 2024
@georgebid georgebid merged commit ce372ab into umbraco:contrib Mar 25, 2024
13 of 15 checks passed
@georgebid
Copy link
Contributor

Hey @nagolucky18! Thanks a lot for putting in a fix for this issue, I am happy to say that everything tested as expected, and I have merged this one in 😄 You should see this in the next release!

@keithlfs
Copy link

keithlfs commented Apr 17, 2024

@nul800sebastiaan please consider putting this back into 13.3.x as v14 is a major upgrade and we won't be able to move to it for some time due to back-office compatibility constraints. In the meantime our rollback facility is broken until we can have this fix.

@keithlfs
Copy link

This seems to have been left out, it's not made it into v14 and there appears to be no 13.4 release planned. This issue has completely broken our rollback capability and this fix should be better prioritised, in my opinion. We're having to create our own custom Umbraco build incorporating this change until such time that it makes it into an official release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rolling back multilingual content does not work on non varied fields.
6 participants