Newsdetails
Fehler bei der Verarbeitung der Vorlage.
The following has evaluated to null or missing:
==> element.media.getData()?string?split("/")[7]  [in template "20116#20154#NEWS_DETAIL" at line 138, column 44]

----
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 mediaID = element.media.getDa...  [in template "20116#20154#NEWS_DETAIL" at line 138, column 25]
----
1<#-- Retrieve the published date meta data field of the web content --> 
2<#assign displaydate = .vars['reserved-article-display-date'].data> 
3<#-- Set the page locale to the portals default locale --> 
4<#setting locale = localeUtil.getDefault()> 
5<#-- Parse the date to a date object --> 
6<#assign displaydate = displaydate?datetime("EEE, d MMM yyyy HH:mm:ss Z")> 
7<#-- Set the page locale back to the original page locale --> 
8<#assign locale = localeUtil.getSiteDefault()> 
9 
10<#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") /> 
11<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
12<#assign group = groupLocalService.getGroup(siteGroupId) /> 
13<#assign globalGroupId = themeDisplay.getCompanyGroupId() /> 
14<#assign facebookLink = group.getExpandoBridge().getAttribute("Social Media Facebook")!"" /> 
15<#assign instagramLink = group.getExpandoBridge().getAttribute("Social Media Instagram")!"" /> 
16<#assign linkedInLink = group.getExpandoBridge().getAttribute("Social Media LinkedIn")!"" /> 
17 
18<#if (embeddedArticleIdFieldSet.embeddedArticleId.getData())??> 
19    <#assign embeddedArticleId=embeddedArticleIdFieldSet/> 
20</#if> 
21 
22 
23<#macro articleEmbed position articleId=""> 
24    <#if articleId?has_content && articleId.getSiblings()?has_content> 
25 
26        <#list articleId.getSiblings() as currentArticleId> 
27            <#assign embeddedArticleIdRef = currentArticleId.embeddedArticleId.getData()?string /> 
28 
29            <#if embeddedArticleIdRef?? && embeddedArticleIdRef?has_content && currentArticleId.embeddedArticlePosition?has_content && currentArticleId.embeddedArticlePosition.getData() == position> 
30            <#-- helpful debug information 
31                <h2>Article Id: ${currentArticleId.getData()?string}</h2> 
32                <h3>Site group Id: ${siteGroupId}</h3> 
33                <h3>Global group Id: ${globalGroupId}</h3> 
34             --> 
35 
36                <#if journalArticleLocalService.hasArticle(globalGroupId, embeddedArticleIdRef)> 
37                    <#local articleGlobal = journalArticleLocalService.fetchArticle(globalGroupId, embeddedArticleIdRef) /> 
38                </#if> 
39 
40                <#if articleGlobal??> 
41                    <#attempt> 
42                        <#local webArticleContent = journalArticleLocalService.getArticleContent(articleGlobal, articleGlobal.getDDMTemplateKey(), "VIEW", locale, objectUtil("com.liferay.portal.kernel.portlet.PortletRequestModel", renderRequest, renderResponse), themeDisplay)/> 
43 
44                        <#if webArticleContent??> 
45                            ${webArticleContent} 
46                        </#if> 
47                        <#recover> 
48                    </#attempt> 
49                <#else> 
50                    <#if journalArticleLocalService.hasArticle(siteGroupId, embeddedArticleIdRef)> 
51                        <#local siteArticle = journalArticleLocalService.fetchArticle(siteGroupId, embeddedArticleIdRef) /> 
52                    </#if> 
53 
54                    <#if siteArticle?? > 
55                        <#attempt> 
56                            <#local preferencesMap = { 
57                            "portletSetupPortletDecoratorId": "barebone", 
58                            "groupId": siteGroupId, 
59                            "articleId": embeddedArticleIdRef 
60                            } /> 
61                            <#local instanceId = "news_embedded_" + embeddedArticleIdRef /> 
62 
63                            <@liferay_portlet["runtime"] 
64                            defaultPreferences=freeMarkerPortletPreferences.getPreferences(preferencesMap) 
65                            instanceId="${instanceId}" 
66                            portletProviderAction=portletProviderAction.VIEW 
67                            portletName="com_liferay_journal_content_web_portlet_JournalContentPortlet"/> 
68                            <#recover> 
69                        </#attempt> 
70                    </#if> 
71                </#if> 
72            </#if> 
73        </#list> 
74    </#if> 
75</#macro> 
76<div class="container "> 
77    <h1>${title.getData()}</h1> 
78    <p class="meta">${displaydate?string["dd.MM.yyyy"]}<#if authorName?? && authorName.getData() != ""> | ${authorName.getData()}</#if></p> 
79 
80    <@articleEmbed articleId=embeddedArticleId position="afterTitle" /> 
81 
82    <p class="lead">${summary.getData()}</p> 
83 
84    <#if folderId?? && folderId.getData() != ""> 
85        <#assign folderId = folderId.getData()/> 
86        <#assign instanceId = "folder_" + folderId/> 
87        <#assign preferences = freeMarkerPortletPreferences.getPreferences({ 
88        "rootFolderId": "${folderId}", 
89        "displayStyleGroupId": "20145", 
90        "mimeTypes": ["image/jpeg", "image/png", "image/jpg"] 
91        }) /> 
92        <#if imageGalleryTitle?? && imageGalleryTitle.getData() != ""> 
93            <h2>${imageGalleryTitle.getData()}</h2> 
94        </#if> 
95 
96 
97        <@liferay_portlet["runtime"] 
98        defaultPreferences="${preferences}" 
99        instanceId="${instanceId}" 
100        portletName="com_liferay_document_library_web_portlet_IGDisplayPortlet" 
101        /> 
102 
103 
104    <#elseif picture.getData()?? && picture.getData() != ""> 
105        <p class="news-details__image-container"> 
106            <#if pictureLink?? && pictureLink.getData()?? && pictureLink.getData() != ""> 
107                <a class="news-details__image-link" href="${(pictureLink??)?then(pictureLink.getData(),"")}"> 
108                    <img 
109                            data-fileentryid="${picture.getAttribute("fileEntryId")}" 
110                            alt="${picture.getAttribute("alt")}" 
111                            src="${picture.getData()}" 
112                    /> 
113                </a> 
114            <#else> 
115                <span class="news-details__image-link"> 
116				<img 
117                        data-fileentryid="${picture.getAttribute("fileEntryId")}" 
118                        alt="${picture.getAttribute("alt")}" 
119                        src="${picture.getData()}" 
120                /> 
121			</span> 
122            </#if> 
123            <#if pictureLegend?? && pictureLegend.getData()??><span class="meta">${pictureLegend.getData()}</span></#if> 
124        </p> 
125    </#if> 
126 
127    <@articleEmbed articleId=embeddedArticleId position="beforeMain" /> 
128    <p>${content.getData()}</p> 
129    <@articleEmbed articleId=embeddedArticleId position="afterMain" /> 
130 
131    <#assign listMedia = attachmentsFieldSet.mediaFieldSet.getSiblings() /> 
132    <#if listMedia[0].media.getData()?has_content> 
133        <h5 class="mb-3 mt-5">${attachmentsFieldSet.attachments.getData()}</h5> 
134        <#if attachmentsFieldSet.attachments.getSiblings()?has_content> 
135            <ul class="list-unstyled"> 
136                <#list listMedia as element> 
137                    <#if element.media.getData()?has_content> 
138                        <#assign mediaID = element.media.getData()?string?split("/")[7]?split("?")[0]> 
139                        <#assign groupId = element.media.getData()?string?split("/")[4]?number> 
140                        <#assign DLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") /> 
141                        <#assign file=DLFileEntryLocalService.getFileEntryByUuidAndGroupId(mediaID, groupId)> 
142                        <#assign fileTitle = file.title> 
143                        <#if element.mediaTitle?? && element.mediaTitle.getData()?? && element.mediaTitle.getData() != ""> 
144                            <#assign fileTitle = element.mediaTitle.getData()> 
145                        </#if> 
146 
147                        <li class="mb-2"> 
148                            <a download target="_blank" href="${element.media.getData()}"> 
149                                <i class="mr-3 icon icon-download-3"></i> 
150                                ${fileTitle} (${file.extension?upper_case}, ${(file.getSize()/1024)?string(",##0")} KB) 
151                            </a> 
152                        </li> 
153                    </#if> 
154                </#list> 
155            </ul> 
156        </#if> 
157    </#if> 
158 
159    <@articleEmbed articleId=embeddedArticleId position="atEnd" /> 
160 
161    <#if (facebookLink?? && facebookLink != "") || (instagramLink?? && instagramLink != "") || (linkedInLink?? && linkedInLink != "")> 
162        <div class="news-details__social-media-section"> 
163            <p> 
164                <#if socialMediaTitle?? && socialMediaTitle.getData()?? && socialMediaTitle.getData() != ""> 
165                    ${socialMediaTitle.getData()} 
166                <#else> 
167                    Folgen Sie uns auf Social Media 
168                </#if> 
169            </p> 
170            <div class="news-details__social-media-links"> 
171                <#if facebookLink?? && facebookLink != ""><a href="${facebookLink}"><i class="icon-facebook"></i></a></#if> 
172                <#if instagramLink?? && instagramLink != ""><a href="${instagramLink}"><i class="icon-instagram"></i></a></#if> 
173                <#if linkedInLink?? && linkedInLink != ""><a href="${linkedInLink}"><i class="icon-linkedin"></i></a></#if> 
174            </div> 
175        </div> 
176    </#if> 
177 
178    <hr> 
179 
180    <a class="mt-auto" href="javascript:window.history.back()"> 
181        <i class="mr-2 icon icon-arrow-left-12"></i> 
182        <@liferay.language key="back"/> 
183    </a> 
184</div> 
185 
186<script> 
187    const wrapper = document.querySelector('.card-page'); 
188    if (wrapper) { 
189        const elements = Array.from(wrapper.getElementsByTagName('picture')); 
190        elements.map(element => element.nextSibling.nodeValue = ''); 
191
192</script> 
193 
194<!--Updated by clavisIT ddmSync-->