نوع المحتوى

الفئات

الجهة

تم التحديث من

تم التحديث من
الرجاء إختيار نوع.

تم التحديث إلى

تم التحديث إلى
الرجاء إختيار نوع.
يكتب
تصنيف
تصنيف
تصنيف
حصل خطأ عند معالجة القالب.
The following has evaluated to null or missing:
==> assetEntry.getAssetRenderer()  [in template "70645677960193#20119#33728" at line 35, column 94]

----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign assetRenderer = assetEntry?ha...  [in template "70645677960193#20119#33728" at line 35, column 41]
----
1<#assign monthArr = ['january','february','march','april','may','june','july','august','september','october','november','december'] /> 
2<div class="search-result"> 
3	<div class="gup-filterchip-wrapper mb-4 d-none"> 
4		<span class="label"><@liferay.language key="search-in" /></span> 
5			<div class="gup-filter-tags"> 
6			</div> 
7			<div class="gup-filter-chip "> 
8				<button class="filter-chip btn btn-secondary clear-all"> 
9					<span class="icon d-flex"> 
10						<i class="ri-refresh-line"></i> 
11					</span> 
12				<@liferay.language key="gup.clear.all" /> 
13				</button> 
14			</div> 
15	</div> 
16	<div class="result-found search-total-label"> 
17		<h3 class="h4">${languageUtil.format(locale, "gup-x-result-found", [searchContainer.getTotal()], false)}</h3> 
18		<div class="result-sort"> 
19			<@liferay_portlet["runtime"] 
20				instanceId="search_result_sort_search" 
21				portletName="com_liferay_portal_search_web_internal_sort_portlet_SortPortlet_INSTANCE_nndp_sortSelection" 
22			/> 
23		</div> 
24	</div> 
25  <hr class="mb-5 mt-0 d-none"> 
26	<div class="search-list"> 
27		<#assign list = entries?size /> 
28		<ul class="list-group"> 
29			<#if entries?has_content> 
30				<#list entries as entry> 
31					<#assign className = entry.getClassName() /> 
32					<#assign classPK = entry.getClassPK() /> 
33					<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
34					<#assign assetEntry = assetEntryLocalService.fetchEntry(className, classPK) /> 
35					<#assign assetRenderer = assetEntry?has_content?then(assetEntry.getAssetRenderer(), null) /> 
36					<#assign fields = assetRenderer.getDDMFormValuesReader().getDDMFormValues().getDDMFormFieldValues()/> 
37					 
38					<#assign  
39						viewUrl = entry.getViewURL() 
40						isDownload = false 
41						displayTitle = entry.getHighlightedTitle()			  
42						/> 
43						<#if entry.getClassName() == "com.liferay.document.library.kernel.model.DLFileEntry"> 
44							<#assign   
45								dlAppLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService") 
46								fileEntry = dlAppLocalService.getFileEntry(entry.getClassPK()) 
47								fileTitle = htmlUtil.unescape(fileEntry.getTitle()) 
48								fileEntryURL = themeDisplay.getPathContext() + "/documents/" + fileEntry.getRepositoryId()?c + "/" + fileEntry.getFolderId()?c + "/" + urlCodec.encodeURL(fileTitle, true) + "/" + fileEntry.getUuid() 
49								viewUrl = fileEntryURL  
50								isDownload = true 
51							/>   
52							<#if (fields?size gt 0)> 
53								<#assign fileTitleValue = fields[0].getValue().getString(locale) /> 
54							<#else> 
55								<#if (fileEntry.title)??> 
56									<#assign fileTitleValue= htmlUtil.unescape(fileEntry.getTitle()) /> 
57								</#if> 
58							</#if> 	 
59					</#if> 
60 
61					<li class="result-item"> 
62						<div class="result-item-title">	 
63						 
64							<a href="${viewUrl}" <#if isDownload>download="${fileTitle}"</#if>> 
65							<#if isDownload> 
66								${fileTitleValue} 
67							<#else> 
68								${displayTitle} 
69							</#if> 	 
70						 
71   <#--${entry.getHighlightedTitle()}--> 
72              </a> 
73							<#if entry.isAssetCategoriesOrTagsVisible()> 
74								<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") /> 
75 
76								<#assign assetEntry = assetEntryLocalService.fetchEntry(entry.getClassName(), entry.getClassPK()) /> 
77								<#assign catIds = assetEntry.getCategoryIds() /> 
78 
79										<#list catIds as catID> 
80												<#if catID = 33116> 
81														<p class="result-badge flex-shrink-0 align-self-start"><@liferay.language key="step-by-step" /></p> 
82												</#if> 
83										</#list> 
84							</#if> 
85						</div> 
86 
87						 
88 
89						<div class="search-item-description"> 
90							<#if isDownload  
91								&& (fields?size > 1)  
92								&& fields[1]??  
93								&& fields[1].getValue().getString(locale)?has_content> 
94								<#assign fileDescription = fields[1].getValue().getString(locale) /> 
95								<p>${fileDescription}</p> 
96							<#elseif entry.isContentVisible()> 
97								<p>${entry.getContent()}</p> 
98							</#if> 
99						</div> 
100						 
101						<#setting locale=locale.toString()> 
102						<#setting time_zone=timeZone.ID>		 
103							 
104						<#assign Date_DateObj = entry.getModifiedDateString()?date> 
105						<#assign month = dateUtil.getDate(Date_DateObj, "MM", locale) /> 
106						<#assign day = dateUtil.getDate(Date_DateObj, "dd", locale) /> 
107						<#assign year = dateUtil.getDate(Date_DateObj, "yyyy", locale) /> 
108						<#assign monthName = monthArr[month?number-1] />            					 
109						<#assign formattedDate = day+" "+languageUtil.get(locale, monthName)+" "+year />													 
110							 
111						<span class="search-item-date c-gap-2"> 
112							<#if entry?has_content> 
113								<@liferay.language key="updated" />:  
114								 
115								<#assign parsedDate = formattedDate?date("dd MMMM yyyy")> 
116                <#assign dateString = parsedDate?string("yyyy-MM-dd")> 
117									 
118								<time class="ml-0 p-0 text-dark" datetime="${dateString}"> 
119									${formattedDate} 
120								</time> 
121							</#if> 
122						</span> 
123						 
124					</li> 
125				</#list> 
126			<#else> 
127				 <div class="no-result-found"> 
128           <h4 class="mb-0">${languageUtil.get(locale, "gup.no.results.found")}</h4> 
129           <p class="mt-3 primary-content mb-0">${languageUtil.get(locale, "gup.no.results.found.description")}</p> 
130         </div> 
131			</#if> 
132		</ul> 
133	</div> 
134</div> 
135								 
136<script> 
137	let listSize = ${list}; 
138	if(listSize === 0){ 
139		$(".result-found.search-total-label").addClass("d-none"); 
140		$(".search-result hr").removeClass("d-none"); 
141		$(".gup-filterchip-wrapper").removeClass("mb-4"); 
142		$(".gup-filterchip-wrapper").addClass("mb-0"); 
143	}else{ 
144		$(".result-found.search-total-label").removeClass("d-none"); 
145		$(".search-result hr").addClass("d-none"); 
146		$(".gup-filterchip-wrapper").addClass("mb-4"); 
147		$(".gup-filterchip-wrapper").removeClass("mb-0"); 
148
149		const links = document.querySelectorAll('.search-list .result-item-title a'); 
150		links.forEach(link => { 
151		const url = new URL(link.href); 
152		url.search = ''; 
153		link.href = url.toString(); 
154		}); 
155 
156	(function () { 
157  // Select all dropdown containers on the page 
158  const $dropdowns = $('.categories-dropdown'); 
159 
160  // Helper: Check if any checkbox inside is selected 
161  function hasAnyChecked($container) { 
162    return $container.find('input[type="checkbox"]:checked').length > 0; 
163
164 
165  // Helper: Close dropdown menu 
166  function closeDropdown($container) { 
167    const $button = $container.find('.dropdown-toggle'); 
168    const $menu = $container.find('.dropdown-menu'); 
169    $container.removeClass('show'); 
170    $menu.removeClass('show'); 
171    $button.attr('aria-expanded', 'false'); 
172
173 
174  // Handle click outside 
175  $(document).on('mousedown.gup touchstart.gup', function (evt) { 
176    $dropdowns.each(function () { 
177      const $container = $(this); 
178      const $menu = $container.find('.dropdown-menu'); 
179      if ($menu.hasClass('show')) { 
180        const isInside = $.contains($container.get(0), evt.target) || $container.is(evt.target); 
181        if (!isInside && !hasAnyChecked($container)) { 
182          closeDropdown($container); 
183
184
185    }); 
186  }); 
187 
188})(); 
189</script>