I am facing a very complicated situation with kentico repeater transformation, where I have created 3 custom repeaters to process the following attachments fields "Images, Reports and Files", which i created in the page type to separate attachments by type. so to process my data I followed this post to create the below transformation:
<%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %><%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachmentsVideo.ascx" TagName="DocumentAttachmentsVideo" TagPrefix="cms" %>
< script runat="server">
protected override void OnInit(EventArgs e)
{
CMS.DataEngine.DataClassInfo dci = CMS.DataEngine.DataClassInfoProvider.GetDataClassInfo(Eval("ClassName").ToString(), true);
if (dci != null)
{
CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(dci.ClassFormDefinition);
// field name we added in the page type
CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField("Images");
CMS.FormEngine.FormFieldInfo ffiReports = fi.GetFormField("Reports");
CMS.FormEngine.FormFieldInfo ffiFiles = fi.GetFormField("Files");
Guid AttachmentGroupGUID = ffi.Guid;
Guid AttachmentGroupGUIDRep = ffiReports.Guid;
Guid AttachmentGroupGUIDFil = ffiFiles.Guid;
ucDocAttachments.Path = Eval<string>("NodeAliasPath");
ucDocAttachmentReports.Path = Eval<string>("NodeAliasPath");
ucDocAttachmentFil.Path = Eval<string>("NodeAliasPath");
ucDocAttachments.AttachmentGroupGUID = AttachmentGroupGUID;
ucDocAttachmentReports.AttachmentGroupGUID = AttachmentGroupGUIDRep;
ucDocAttachmentFil.AttachmentGroupGUID = AttachmentGroupGUIDFil;
ucDocAttachments.TransformationName = "CMS.Root.Attachment";
ucDocAttachmentReports.TransformationName = "CMS.Root.AttachmentLinks";
ucDocAttachmentFil.TransformationName = "CMS.Root.AttachmentLinks";
ucDocAttachments.StopProcessing = false;
ucDocAttachmentReports.StopProcessing = false;
ucDocAttachmentFil.StopProcessing = false;
ucDocAttachments.ReloadData(true);
ucDocAttachmentReports.ReloadData(true);
ucDocAttachmentFil.ReloadData(true);
}
}
< /script>
<div class="innerSelectedElectionContainer col-xs-12 selected-<%# DataItemIndex %>">
<div class="col-xs-12 selectedElectionInfo selectedContent-0">
<div class="col-xs-12 selectedElectionTitle elem-to-hide">
<%# Eval("Title") %>
</div>
<div class="col-xs-12 selectedElectionText elem-to-hide">
<%# Eval("Text") %>
</div>
</div>
<div class="selectedElectionInfo elem-to-hide selectedContent-1">
<div class="col-xs-12 photosLabel"><%# Localize("{$photosGallery$}") %></div>
<div class="col-xs-12 noPaddingSides FlexWrap"> <cms:DocumentAttachments ID="ucDocAttachments" runat="server" PageSize="100" GetBinary="false" />
</div>
</div>
<div class="selectedElectionInfo elem-to-hide selectedContent-2 col-xs-12">
<div class="col-xs-12 photosLabel"><%# Localize("{$videosGallery$}") %></div><cms:DocumentAttachmentsVideo ID="DocumentAttachmentsVideo" runat="server" GetBinary="false" StopProcessing="true" ImageFieldValues='<%# Eval("Videos") %>' />
</div>
<div class="selectedElectionInfo elem-to-hide selectedContent-3">
<div class="col-xs-12 photosLabel"><%# Localize("{$reports$}") %></div>
<div class="col-xs-12 selectedContent-3 ElectionReports"><cms:DocumentAttachments ID="ucDocAttachmentReports" PageSize="100" runat="server" GetBinary="false" StopProcessing="true" /> </div>
</div>
<div class="selectedElectionInfo elem-to-hide selectedContent-4">
<div class="col-xs-12 photosLabel"><%# Localize("{$files$}") %></div>
<div class="col-xs-12 selectedContent-4 ElectionFiles"><cms:DocumentAttachments ID="ucDocAttachmentFil" PageSize="100" runat="server" GetBinary="false" StopProcessing="true" />
</div>
</div></div>
But the problem is that the system is now returning an out of memory exception, which was for certain time temporary, but now the website is not processing at all, i am having a hard time finding the reason, because the system works for some data, and after a certain refresh it returns the exception for the same data, so its random, here's a screenshot for the event logs:
when referring back to the code behind I found that the exception is executing on this line: ucRepeater.DataSource = ucDataSource.DataSource;
Does someone knows whats wrong and how can I fix this??