Closed MatteoPiovanelli-Laser closed 12 months ago
For example, I worry about import/export scenarios
I don't recall any reason it's not in the infoset.
Maybe run the specflow tests (based on Benedek's changes)
Leaving this open for the results of the tests
Specflows seem fine. To be fair, I'm not sure they involve localization. I'm closing this issue anyway.
The
LazyField
s inLocalizationPart
are "backed" by information in theLocalizationPartRecord
. In theLoader
andSetter
for thoseLazyField
s we are currently referring directly to properties of the Record. https://github.com/OrchardCMS/Orchard/blob/610b3c4f53ce9a4bdbe26a5a095bd606bfabc811/src/Orchard.Web/Modules/Orchard.Localization/Handlers/LocalizationPartHandler.cs#L32 As a consequence, whenever there is aContentItem
that has aLocalizationPart
and we need to access one of those properties, a query has to be performed. This happens often when displaying multi-language websites that rely on localized content and widgets: we easily end up having 10+ queries for that to visualize a simple page.It seems trivial to use
Store
/Retrieve
methods in theLoader
andSetter
for thoseLazyField
s. I have a PR coming soon for this. I've tested it a little, and it seems to work for all cases I've put it through, but localization is a complex topic so I'm not yet 100% sure I've covered all corner cases.