Благоустройство

Во время обработки запрошенного шаблона произошла ошибка...
The following has evaluated to null or missing:
==> ddmFormValuesMap['publishDate']  [in template "429355#429390#1874772" at line 36, column 32]

----
Tip: It's the final [] step that caused this error, not those before it.
----
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 publishDate = ddmFormValuesMa...  [in template "429355#429390#1874772" at line 36, column 9]
----
1<#assign DocumentConversionUtil = staticUtil["com.liferay.document.library.kernel.document.conversion.DocumentConversionUtil"]> 
2<#assign AssetVocabularyLocalServiceUtil = staticUtil["com.liferay.asset.kernel.service.AssetVocabularyLocalServiceUtil"]> 
3<#if entries?has_content> 
4    <#assign layoutId = themeDisplay.getLayout().getPlid()/> 
5    <#assign portletId = htmlUtil.escapeAttribute(portletDisplay.getId())/> 
6    <#assign addToPagePermission = portletPermission.contains(permissionChecker, layoutId, portletId, 'ADD_TO_PAGE')/> 
7 
8    <table class="table table-bordered table-hover"> 
9    <thead> 
10		<tr> 
11			<th>Дата принятия</th> 
12			<th>Номер</th> 
13			<th>Вид документа</th> 
14			<th>Название</th> 
15			<#if addToPagePermission> 
16    			<th>Изменить</th> 
17    			<th>Оригинал</th> 
18			</#if> 
19		</tr> 
20	</thead> 
21	<tbody> 
22    <#list entries as entry> 
23        <#assign renderer = entry.getAssetRenderer()/> 
24        <#assign valuesReader = renderer.getDDMFormValuesReader()/> 
25        <#assign ddmFormValues = valuesReader.getDDMFormValues()/> 
26        <#assign ddmFormValuesMap = ddmFormValues.getDDMFormFieldValuesMap()/> 
27        <#assign categories = entry.getCategories()/> 
28 
29        <#assign fileEntry = renderer.getAssetObject()/> 
30        <#assign extension = fileEntry.getExtension()/> 
31 
32        <#assign description = entry.getDescription(locale)/> 
33 
34        <#assign date = ddmFormValuesMap['date'][0].getValue().getString(locale)/> 
35        <#assign number = ddmFormValuesMap['number'][0].getValue().getString(locale)/> 
36        <#assign publishDate = ddmFormValuesMap['publishDate'][0].getValue().getString(locale)/> 
37        <#assign downloadUrl = renderer.getURLDownload(themeDisplay)/> 
38        <#assign downloadSourceUrl = downloadUrl/> 
39         
40        <#if date?has_content> 
41            <#assign formatedDate = date?datetime("yyyy-MM-dd")?date/> 
42        </#if> 
43 
44        <#if publishDate?has_content> 
45            <#assign formatedPublishDate = publishDate?datetime("yyyy-MM-dd")?date/> 
46        <#elseif date?has_content> 
47            <#assign formatedPublishDate = entry.getPublishDate()?date/> 
48        </#if> 
49         
50         
51        <#assign documentTypeVocabulary = AssetVocabularyLocalServiceUtil.getVocabulary(446641)/> 
52        <#assign documentTypeCategories = documentTypeVocabulary.getCategories()/> 
53         
54        <#assign documentType = 'Документ'/> 
55        <#list categories as category> 
56            <#list documentTypeCategories as documentTypeCategory> 
57                <#if category.getCategoryId() == documentTypeCategory.getCategoryId()> 
58                    <#assign documentType = category.getName()/> 
59                </#if> 
60            </#list> 
61        </#list> 
62        
63        <#assign target = ''/> 
64        <#assign isConvertible = DocumentConversionUtil.getConversions(extension)?seq_contains('pdf')/> 
65        <#if isConvertible> 
66    		<#assign downloadUrl = downloadUrl?replace('&download=true', '')/> 
67    		<#assign downloadUrl = downloadUrl + '&targetExtension=pdf'/> 
68    		<#assign target = 'target="_blank"'/> 
69    	</#if> 
70    	<#if extension == 'pdf'> 
71    		<#assign downloadUrl = downloadUrl?replace('&download=true', '')/> 
72    		<#assign target = 'target="_blank"'/> 
73    	</#if> 
74    	<#assign editPermission = layoutPermission.contains(permissionChecker, layoutId, 'EDIT')/> 
75    	<#assign editUrl = renderer.getURLEdit(renderRequest,renderResponse,windowStateFactory.getWindowState("NORMAL"),portletURLFactory.create(renderRequest, themeDisplay.getPortletDisplay().getId(),themeDisplay.getPlid(), "RENDER_PHASE"))/> 
76 
77        <tr> 
78            <td>${formatedDate}</td> 
79            <td>${number}</td> 
80            <td>${documentType}</td> 
81            <td> 
82                <a href="${downloadUrl}" target="${target}" class="d-block">${description}</a> 
83                <span class="reference-mark">Дата публикации: ${formatedPublishDate}</span> 
84            </td> 
85             <#if editPermission> 
86            <td> 
87    			<a href="${editUrl}" class="text-secondary"> 
88    				<@liferay.language key="edit" /> 
89    			</a> 
90            </td> 
91            <td> 
92    			<a href="${downloadSourceUrl}" class="text-secondary"> 
93    				<@liferay.language key="download" /> 
94    			</a> 
95            </td> 
96            </#if> 
97		</tr> 
98	</#list> 
99	</tbody> 
100	</table> 
101</#if>