Open orchardbot opened 9 years ago
@jtkech commented:
Update
In the Replace section of 1) Change descriptorFeatures = ... with descriptor.Features = ...
Sorry
Note :The person on orchardpros.net seems to have others symptoms. So I'm not sure for the fixes. I will investigate. But the symptoms exists
Regards
@jtkech commented:
Even I never use a Theme base on another one, I just tried it again For infos, I can repro each time on a 1.8.1 version, but I can't repro on a 1.8.x version Maybe because of the new Sessions / Transactions implementation (e.g in SessionLocator.cs)
Regards
PaulDevenney commented:
this is almost certainly the same issue as https://orchard.codeplex.com/workitem/21176.
@jtkech created: https://orchard.codeplex.com/workitem/21111
Somebody was concerned by this issue, see http://www.orchardpros.net/tickets/4683 He had a ShellFeature table of 200000 rows and cache.dat size of about 3 Mb
The fix is to enable the theme and the base theme in one pass
In ThemeService.cs, in EnableThemeFeatures() method
Replace
while (themes.Count > 0) _featureManager.EnableFeatures(new[] {themes.Pop()});
With if (themes.Count > 0) // Evolutive _featureManager.EnableFeatures(themes.ToList());
Note: Same kind of fix to do in DisableThemeFeatures()
In case of this can be caused by another source, I propose another fix with these benefits With 1) and 2), the internal features list in memory has always only distinct features With 1), by enabling / disabling a feature, a clean table and cache.dat are regenerated
1) In ShellDescriptorManager.cs, in GetShellDescriptorFromRecord() method
Replace
descriptor.Features = descriptorFeatures;
With descriptorFeatures = descriptorFeatures.GroupBy(x => x.Name).Select(g => g.First()).ToList();
2) In ShellDescriptorCache.cs, in GetShellDecriptorForCacheText() method
Replace
shellDescriptor.Features = features.Select(feature => new ShellFeature { Name = feature }).ToList();
With shellDescriptor.Features = features.Select(feature => new ShellFeature { Name = feature }) .GroupBy(x => x.Name).Select(g => g.First()).ToList();