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

Allow duplicates #25

Merged
merged 5 commits into from May 13, 2019

Conversation

@fhogberg
Copy link
Contributor

commented May 13, 2019

Patch to allow for export even if there are duplicate resources with the same key.
New -d option added to allow this

}
else
{
var resourceEntry = new LocalizationResource
{
ResourceKey = resourceKey,
ResourceKey = resourceKey.ToLower(),

This comment has been minimized.

Copy link
@valdisiljuconoks

valdisiljuconoks May 13, 2019

Owner

I'm sure about this line.. It might cause problems later to look up this resource as not yet everywhere resource key is made case insensitive

This comment has been minimized.

Copy link
@fhogberg

fhogberg May 13, 2019

Author Contributor

I was under the assumption that once in epi keys are case insensitive because trying to import a json with same key with different case throws an exception. If that is true it should not matter that all keys are made lowercase.
Is it intended that keys are case sensitive? In that case the current behaiviour is correct and the import should be modified to allow it.

This comment has been minimized.

Copy link
@valdisiljuconoks

valdisiljuconoks May 13, 2019

Owner

case sensitivity is for generated keys from code (for now). this will be changed in next major version.
is it possible for you to try out to import key in UPPER case and call Episerver API with lower? This might collide with use case when migration is done for "normal" resources (like with key Namespace.Class.Property)

@valdisiljuconoks

This comment has been minimized.

Copy link
Owner

commented May 13, 2019

thanks for PR. this is much appreciated and duplicates definitely could be an issue when dealing with pile of XML files.. Can you please check that line regarding resourceKey.ToLower() ?

@fhogberg

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2019

Pushed a new commit.
Now the compare is case insensitive but the key is imported in correct case of the first occurance of the key.
Will this work?

@valdisiljuconoks

This comment has been minimized.

Copy link
Owner

commented May 13, 2019

yup, this might blend

@valdisiljuconoks valdisiljuconoks merged commit fa769dc into valdisiljuconoks:master May 13, 2019

@valdisiljuconoks valdisiljuconoks added this to the 5.7 milestone May 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.