Asset Publisher

An error occurred while processing the template.
The string doesn't match the expected date/time/date-time format. The string to parse was: "2016-07-08 null:null". The expected format was: "yyyy-MM-dd HH:mm".
The nested reason given follows:
Unparseable date: "2016-07-08 null:null"

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign dateFull = (dateFull?datetime...  [in template "10112#522485#25803229" in macro "getDateField" at line 156, column 21]
	- Reached through: @getDateField fecha=fechaInicio hora=...  [in template "10112#522485#25803229" at line 57, column 57]
----
1<#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")> 
2<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")> 
3<#if themeDisplay.getTheme().getContextPath() == "/o/upv-ehu-global-theme"> 
4<#assign colorSchemeId = themeDisplay.getColorSchemeId() /> 
5<#if colorSchemeId?has_content && colorSchemeId=="08"> 
6	<#if entries?has_content> 
7    <div class="news_list-wrapper"> 
8        <h2 class="title">${languageUtil.get(locale, "centros.title.events")} </h2> 
9        <ul class="list-group news_list-list"> 
10            <#list entries as entry>				 
11                <#assign assetRenderer = entry.getAssetRenderer() /> 
12 
13                <#assign docXml = saxReaderUtil.read(entry.getAssetRenderer().getArticle().getContentByLocale(locale))/> 
14                <#assign pretitulo = docXml.valueOf("//dynamic-element[@name='ehupretitle']/dynamic-content/text()") /> 
15                <#assign titulo = docXml.valueOf("//dynamic-element[@name='ehutitle']/dynamic-content/text()") /> 
16                <#assign subtitulo = docXml.valueOf("//dynamic-element[@name='ehunewsubtitle']/dynamic-content/text()") /> 
17                 
18                <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, entry) /> 
19 
20                <#if assetLinkBehavior != "showFullContent"> 
21                    <#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) /> 
22                </#if> 
23                <li class="list-group-item news_list-item"> 
24                    <a href="${viewURL}" class="news_list-link"> 
25                        
26					<span class="metadata-entry metadata-publish-date"> 
27					     
28					    <#assign fechaInicio = docXml.valueOf("//dynamic-element[@name='ehustartdatehour']/dynamic-content/text()")!"" /> 
29                        <#assign horaInicio = docXml.valueOf("//dynamic-element[@name='ehustartdatehourhh']/dynamic-content/text()")!""/> 
30                        <#assign minInicio = docXml.valueOf("//dynamic-element[@name='ehustartdatehourmm']/dynamic-content/text()")!"" /> 
31                        <#assign fechaFin = docXml.valueOf("//dynamic-element[@name='ehuenddatehour']/dynamic-content/text()")!""/> 
32                        <#assign horaFin = docXml.valueOf("//dynamic-element[@name='ehuenddatehourhh']/dynamic-content/text()")!""/> 
33						<#assign minFin = docXml.valueOf("//dynamic-element[@name='ehuenddatehourmm']/dynamic-content/text()")!""/> 
34						<#assign showOnlyYearMonth = docXml.valueOf("//dynamic-element[@name='ehushowonlyyearmonth']/dynamic-content/text()")!""/> 
35						 
36												 
37						<#-- Cuando hay hora de inicio y hora de fin es un caso especial ya que hay que pintar primero los días y luego las horas --> 
38						<#if (fechaInicio?has_content || fechaFin?has_content) && (horaInicio?has_content || horaFin?has_content) && showOnlyYearMonth == "" > 
39							<#if fechaInicio?has_content > 
40								<@getDayAndMonth fecha=fechaInicio /> 
41							</#if> 
42							<#if (fechaInicio?has_content && fechaFin?has_content) > 
43							  -  
44							</#if> 
45							<#if fechaFin?has_content > 
46								<@getDayAndMonth fecha=fechaFin /> 
47							</#if>  
48							, <@getHourMin hora=horaInicio minutos=minInicio /> 
49							<#if horaFin?has_content > 
50							  - <@getHourMin hora=horaFin minutos=minFin /> 
51							</#if>											 
52						<#else> 
53							<#--fecha inicio -->																							 
54							<#if showOnlyYearMonth == "true"> 
55								<@getyearmonth fecha=fechaInicio /> 
56							<#else> 
57						    	<@getDateField fecha=fechaInicio hora=horaInicio minutos=minInicio /> 
58							</#if> 
59														 
60							<#--fecha fin -->				 
61							<#if fechaFin?has_content > 
62								<#if showOnlyYearMonth == "true"> 
63									- <@getyearmonth fecha=fechaFin /> 
64								<#else> 
65									- <@getDateField fecha=fechaFin hora=horaFin minutos=minFin /> 
66								</#if>							 
67							</#if> 
68						</#if>	 
69							 							 
70							 
71						 
72					</span>	  
73					 
74					<#if pretitulo?has_content > 
75						<p class="pretitle">${pretitulo}</p> 
76					<#elseif titulo?has_content > 
77						<p>${titulo}</p> 
78					<#elseif subtitulo?has_content > 
79						<p class="subtitle">${subtitulo}</p> 
80					</#if> 
81					 
82                    </a> 
83                </li> 
84            </#list> 
85            <#list portletPreferences?keys as key> 
86                <#assign values = portletPreferences[key] /> 
87                 
88                <#if values?has_content> 
89                    <#if key == "paginationType"> 
90                        <#list values as value> 
91                            <#if value == "none"> 
92                                <li class="list-group-item news_list-item"> 
93									<#-- Se recupera la página de visualización del campo personalizado correspondiente del site -->										 
94									<#assign groupId = themeDisplay.getScopeGroupId()/> 
95									<#assign sitio = groupLocalService.fetchGroup(groupId)/> 
96									<#assign FriendlyPageEvents = (sitio.getExpandoBridge().getAttribute("FriendlyPageEvents"))!""> 
97									<#if FriendlyPageEvents?has_content>	 
98										<#assign friendlyURL = FriendlyPageEvents?string /> 
99										<#if friendlyURL?has_content >										 
100											<#if layoutLocalService.fetchLayoutByFriendlyURL(groupId, false, friendlyURL)??> 
101												<#assign layout = layoutLocalService.fetchLayoutByFriendlyURL(groupId, false, friendlyURL)/>											 
102												<#if layout?? >																 
103													<#assign urlLayout>${portalUtil.getLayoutFriendlyURL(layout, themeDisplay)}</#assign>										 
104													<#if urlLayout?? > 
105														<a class="btn btn-more" href="${urlLayout}" role="button"> 
106														${languageUtil.get(locale, "ehu-view-more")} <i class="icon-chevron-right fa fa-chevron-right" aria-hidden="true"></i>																																				 
107														</a> 
108													</#if> 
109												</#if>	 
110											</#if>														 
111										</#if>														 
112									</#if>														 
113                                </li> 
114                            </#if> 
115                        </#list> 
116                    </#if> 
117                </#if> 
118            </#list> 
119        </ul> 
120    </div> 
121    </#if> 
122<#else> 
123   <div class="alert alert-error">  
124      <@liferay.language key="ehu.error.theme-color" /> 
125   </div> 
126</#if> 
127<#else> 
128   <div class="alert alert-error">  
129      <@liferay.language key="ehu.error.theme-color" /> 
130   </div> 
131</#if> 
132 
133<#macro getDateField fecha hora minutos > 
134     
135		<#assign localeStr = themeDisplay.getLocale() />   
136    	<#setting locale = localeStr>	 
137			<#-- Cuando la hora o el minuto es "00" Liferay devuelve "0" así que hay que arreglarlo --> 
138			<#if hora?has_content && hora == "0"> 
139				<assign hora = "00"> 
140			</#if> 
141			<#if minutos?has_content && minutos == "0"> 
142				<assign minutos = "00"> 
143			</#if> 
144    	 
145    		<#-- <#if fecha?has_content && (hora?has_content && minutos?has_content) && (hora!="0" || minutos!="0") > -->    	 
146			<#if fecha?has_content && (hora?has_content && minutos?has_content)>    	 
147    		    <#assign dateFull =   fecha+" "+hora+":"+minutos /> 
148    		    <#assign dateFormat = "dd MMMM, HH:mm" /> 
149        		<#if localeStr=='eu_ES'> 
150        		     <#assign dateFormat = "MMMM@ dd, HH:mm" />   
151        		<#elseif localeStr=='en_GB'> 
152        		     <#assign dateFormat = "MMMM dd, HH:mm" />                 
153        		</#if> 
154        		<#setting date_format=dateFormat> 
155        		<#if dateFull?has_content> 
156                    <#assign dateFull = (dateFull?datetime("yyyy-MM-dd HH:mm"))?date> 
157                </#if> 
158    		    <#else>   
159    		        <#assign dateFormat = "dd MMMM" /> 
160                	<#if localeStr=='eu_ES'> 
161                	    <#assign dateFormat = "MMMM@ dd" />   
162                	<#elseif localeStr=='en_GB'> 
163                	     <#assign dateFormat = "MMMM dd" />                 
164                	</#if>	 
165                	<#setting date_format=dateFormat>		 
166                	<#if fecha?has_content > 
167                        <#assign dateFull = (fecha?datetime("yyyy-MM-dd"))?date> 
168                    </#if> 
169    		    </#if>    		                     
170    		 
171			<#if dateFull?has_content > 
172        		<#assign modifiedStr = dateFull?string> 
173                <#if localeStr=='eu_ES'> 
174                    ${modifiedStr?replace("@", "K")} 
175                <#else> 
176                    ${modifiedStr} 
177                </#if>			 
178            </#if> 
179</#macro> 
180 
181<#macro getyearmonth fecha >     
182		<#assign localeStr = themeDisplay.getLocale() />   
183    	<#setting locale = localeStr> 
184    	 
185			<#if fecha?has_content >    	 
186    		    <#assign dateFull =   fecha /> 
187    		    <#assign dateFormat = "MMMM" />        		 
188        		<#setting date_format=dateFormat> 
189        		<#if dateFull?has_content> 
190                    <#assign dateFull = (dateFull?datetime("yyyy-MM-dd"))?date> 
191                </#if> 
192			<#else>   
193				<#assign dateFormat = "MMMM" />				 
194				<#setting date_format=dateFormat>		 
195				<#if fecha?has_content > 
196					<#assign dateFull = (fecha?datetime("yyyy-MM-dd"))?date> 
197				</#if> 
198			</#if>    		                     
199    		 
200			<#if dateFull?has_content > 
201        		<#assign modifiedStr = dateFull?string> 
202                	${modifiedStr}                			 
203            </#if> 
204</#macro> 
205 
206<#macro getHourMin hora minutos > 
207     
208		<#assign localeStr = themeDisplay.getLocale() />   
209    	<#setting locale = localeStr>	 
210			<#-- Cuando la hora o el minuto es "00" Liferay devuelve "0" así que hay que arreglarlo --> 
211			<#if hora?has_content && hora == "0"> 
212				<assign hora = "00"> 
213			</#if> 
214			<#if minutos?has_content && minutos == "0"> 
215				<assign minutos = "00"> 
216			</#if> 
217    	    		    	 
218			<#if hora?has_content && minutos?has_content>    	 
219    		    <#assign dateFull = hora+":"+minutos /> 
220    		    <#assign dateFormat = "HH:mm" /> 
221        		<#setting date_format=dateFormat> 
222        		<#if dateFull?has_content> 
223                    <#assign dateFull = (dateFull?datetime("HH:mm"))?date> 
224                </#if> 
225    		    <#else>   
226    		        <#assign dateFormat = "HH:mm" /> 
227                	<#setting date_format=dateFormat>		 
228                	<#if fecha?has_content > 
229                        <#assign dateFull = (fecha?datetime("HH:mm"))?date> 
230                    </#if> 
231    		    </#if>    		                     
232    		 
233			<#if dateFull?has_content > 
234        		<#assign modifiedStr = dateFull?string> 
235                <#if localeStr=='eu_ES'> 
236                    ${modifiedStr?replace("@", "K")} 
237                <#else> 
238                    ${modifiedStr} 
239                </#if>			 
240            </#if> 
241</#macro> 
242 
243<#macro getDayAndMonth fecha >     
244		<#assign localeStr = themeDisplay.getLocale() />   
245    	<#setting locale = localeStr>	 
246    		    	 
247			<#if fecha?has_content>    	 
248    		    <#assign dateFull =   fecha /> 
249    		    <#assign dateFormat = "dd MMMM" /> 
250        		<#if localeStr=='eu_ES'> 
251        		     <#assign dateFormat = "MMMM@ dd" />   
252        		<#elseif localeStr=='en_GB'> 
253        		     <#assign dateFormat = "MMMM dd" />                 
254        		</#if> 
255        		<#setting date_format=dateFormat> 
256        		<#if dateFull?has_content> 
257                    <#assign dateFull = (dateFull?datetime("yyyy-MM-dd"))?date> 
258                </#if> 
259    		    <#else>   
260    		        <#assign dateFormat = "dd MMMM" /> 
261                	<#if localeStr=='eu_ES'> 
262                	    <#assign dateFormat = "MMMM@ dd" />   
263                	<#elseif localeStr=='en_GB'> 
264                	     <#assign dateFormat = "MMMM dd" />                 
265                	</#if>	 
266                	<#setting date_format=dateFormat>		 
267                	<#if fecha?has_content > 
268                        <#assign dateFull = (fecha?datetime("yyyy-MM-dd"))?date> 
269                    </#if> 
270    		    </#if>    		                     
271    		 
272			<#if dateFull?has_content > 
273        		<#assign modifiedStr = dateFull?string> 
274                <#if localeStr=='eu_ES'> 
275                    ${modifiedStr?replace("@", "K")} 
276                <#else> 
277                    ${modifiedStr} 
278                </#if>			 
279            </#if> 
280</#macro>