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

Importing a default language fails if there is only one language #609

Closed
karlmacklin opened this issue Apr 2, 2024 · 1 comment
Closed

Comments

@karlmacklin
Copy link

Describe the bug

If you have only one language and try to import a new language which is set to default, the import fails. You can somewhat avoid this by manually creating the language first, but this is problematic for setups where you rely on automation, so it isn't really a workaround.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new local Umbraco project using Umbraco.Cms version 13.2.2 and uSync 13.1.3.
  2. Start Umbraco and create a new Language (other than english) under settings, setting it to the default language in the process. By now you should have two uSync language files, one updating the initial English one and your new default language.
  3. Stop Umbraco
  4. Delete your database (SQLite files for local dev for example)
  5. Start Umbraco
  6. Go to Settings > uSync and import Settings

Expected behavior

I expect the import to succeed, creating all relevant languages as a first step and afterwards altering which is the default one.

Actual behavior

Import fails, since it can't make english non-default as it is the only language in the system.

Screenshot

image
@Luuk1983
Copy link

Luuk1983 commented Apr 15, 2024

I can confirm that this works fine in uSync 13.0.1, but stopped working in 13.1.x+. Worst is that the content tree remains empty in my case with uSync 13.1.x. Not sure if it's related to this problem, but there is something really wrong with with 13.1.x in my case.

I set up a blank Umbraco 13.2.2 project in combination with a few uSync versions and uSync files from a project I'm having issues with. The uSync config is completely default (so I put no uSync config in the appSettings at all).

Dutch language file:

<?xml version="1.0" encoding="utf-8"?>
<Language Key="00000413-0000-0000-0000-000000000000" Alias="nl-NL" Level="0">
  <Name>Dutch (Netherlands)</Name>
  <IsoCode>nl-NL</IsoCode>
  <IsMandatory>false</IsMandatory>
  <IsDefault>true</IsDefault>
</Language>

English language file:

<?xml version="1.0" encoding="utf-8"?>
<Language Key="00000409-0000-0000-0000-000000000000" Alias="en-US" Level="0">
  <Name>English (United States)</Name>
  <IsoCode>en-US</IsoCode>
  <IsMandatory>false</IsMandatory>
  <IsDefault>false</IsDefault>
</Language>

uSync 13.0.1:

image

Content tree:
image

uSync 13.1.0:

image
Full error:
Cannot save the default language (en-US) as non-default. Make another language the default language instead.

Content tree:
image
The weird thing is that the import says all content is imported correctly, but it simply does not show...

KevinJump added a commit that referenced this issue Apr 15, 2024
KevinJump added a commit that referenced this issue Apr 17, 2024
* From v13: Fixes (#590) - missing null check

* From v13: Fixes #604. don't prepend path with ~ (for no random reason!)

* From v13: Fix #224 - Observe root folder value in rootfolder array if set (and root folders array is not set). (#606)

* From v13: Throw for duplicates ( Jumoo/uSync.Complete.Issues#225 )

* Add serializers and handlers for webhooks. (#613)

* Add serializers and handlers for webhooks.

* Webhook Comments

* From v13: Add serializers and handlers for webhooks. (#613)

* From v13: Fix #609 Default language importing. (#614)

* From v13: Use folders provided in options over config (#610)

* From v13: fix #605 - check delete by serializing item one last time. (#616)

* From v13: Fix - delete entries show up twice in report and actions. (#617)

* From v13: #612 - couple of extra checks so we never try to create an XCData section with a null value. (#618)

* Fix for #619. don't report property deletes as changes when they have… (#621)

* Fix for #619. don't report property deletes as changes when they have already happened

* Add fix for #620 - don't recreate items that are deleted.

* v13 - > v14 null checks.

* From v13: DataType merging Empty items alway win

* update build script

* tidy up logging.

* consistant JSON options

* Add Extra saves for content (not sure we need them! - might be a rc1 issue)

* Add Ability to change the editor alias on import

* Post RC1 - migration fixes.

* chore: project things
KevinJump added a commit that referenced this issue Apr 19, 2024
* From v13: Fixes (#590) - missing null check

* From v13: Fixes #604. don't prepend path with ~ (for no random reason!)

* From v13: Fix #224 - Observe root folder value in rootfolder array if set (and root folders array is not set). (#606)

* From v13: Throw for duplicates ( Jumoo/uSync.Complete.Issues#225 )

* Add serializers and handlers for webhooks. (#613)

* Add serializers and handlers for webhooks.

* Webhook Comments

* From v13: Add serializers and handlers for webhooks. (#613)

* From v13: Fix #609 Default language importing. (#614)

* From v13: Use folders provided in options over config (#610)

* From v13: fix #605 - check delete by serializing item one last time. (#616)

* From v13: Fix - delete entries show up twice in report and actions. (#617)

* From v13: #612 - couple of extra checks so we never try to create an XCData section with a null value. (#618)

* Fix for #619. don't report property deletes as changes when they have… (#621)

* Fix for #619. don't report property deletes as changes when they have already happened

* Add fix for #620 - don't recreate items that are deleted.

* v13 - > v14 null checks.

* From v13: DataType merging Empty items alway win

* update build script

* tidy up logging.

* consistant JSON options

* Add Extra saves for content (not sure we need them! - might be a rc1 issue)

* Add Ability to change the editor alias on import

* Post RC1 - migration fixes.

* chore: project things

* fixes #629 have a custom Operations handler just for uSync swagger endpoint.
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

2 participants