-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Error when trying to update a culture variant property to invariant #10383
Comments
Hi @jreurink Thanks for all the info here. This is going to be an interesting one to try and reproduce so thanks for the tip off as to how to do that easily. We'll take a look and let you know what we come up with. Emma |
We've just run into a second issue in the same 'RenormalizeDocumentEditedFlags' method, but this time it's a SQL error: Apparently the SQL statement that's generated contains too many parameters for SQL Server to handle. @emma-hq Are there any updates on the issue on your end? |
Hey @jreunik, We've taken a look at what's happening here and yes, we are going to label it as up-for-grabs. You've really done the heavy lifting here, narrowing down the issue to exactly where it lives. Perhaps you'd be up for submitting a pr? Either way, I'll pop the label on and see if anyone is up for making a contribution to fix it. Thanks again for your reporting and all the work you've done documenting the issue too, Emma |
Hi @jreurink, We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know. For more information about issues and states, have a look at this blog post Thanks muchly, from your friendly Umbraco GitHub bot :-) |
Hiya @jreurink, Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more. We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed). To open it this issue up again, you can write For example:
This will reopen the issue in the next few hours. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Which Umbraco version are you using?
8.8.2
Bug summary
We have an Umbraco on-premise installation with a large amount (thousands) of culture variant nodes. We are trying to update some culture variant properties to invariant, but we get a server error during saving. The error is as follows:
System.ArgumentException: An item with the same key has already been added.
Stack trace:
stacktrace.txt
Specifics
We've found the issue after some digging around in the source of Umbraco.Core, in the 'RenormalizeDocumentEditedFlags' method of the ContentTypeRepositoryBase, in this statement:
The collection of editedLanguageVersions contains more than 2000 items, which causes the subsequent Database.Fetch call to duplicate its results, which causes the .ToDictionary call to fail.
Steps to reproduce
The issue only occurs when there are more than 2000 items in the collection of editedLanguageVersions, which requires a lot of content nodes, at least a thousand for a site with two languages. An easy way to reproduce it is by altering the source of Umbraco.Core and copying the updated dll in your project. By changing the line
var docCultureVariationsToUpdate = editedLanguageVersions.InGroupsOf(2000)
tovar docCultureVariationsToUpdate = editedLanguageVersions.InGroupsOf(5)
, the bug will be triggered with a lot less content.After that the steps to reproduce are:
editedLanguageVersions.InGroupsOf(5)
, if it's 5, 3-4 nodes should be sufficient.Expected result / actual result
We expect the document type to be updated correctly, but instead it throws an unhandled exception.
The text was updated successfully, but these errors were encountered: