Um erro ocorreu enquanto processava o modelo.
?substring(...) argument #2 had invalid value: The index must be at least 0, but was -1.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign schoolURL = schoolURL?substri...  [in template "20098#20124#37528137" at line 92, column 29]
----
1<#assign prefix = "mpsp"/> 
2 
3<#function getCategoryProperty categoryId, key, defaultValue=""> 
4    <#local categoryProperty = AssetCategoryPropService.fetchCategoryProperty(categoryId, key)! /> 
5    <#return categoryProperty?has_content?then(categoryProperty.getValue(), defaultValue) /> 
6</#function> 
7 
8<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
9<#assign AssetCategoryPropService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") /> 
10<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
11<#assign journalArticle = JournalArticleLocalService.getArticle(getterUtil.getLong(groupId),.vars['reserved-article-id'].data) /> 
12<#assign GroupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") /> 
13<#assign schoolGroup = GroupLocalService.getGroup(user.getCompanyId(), "MPSP - Escola") /> 
14<#assign isSchool = themeDisplay.getScopeGroupId() != schoolGroup.getGroupId() /> 
15 
16<#assign originalLocale = .locale> 
17<#setting locale = localeUtil.getDefault()> 
18<#assign publicationDate = .vars['reserved-article-display-date'].data /> 
19<#assign publicationDate = publicationDate?datetime("EEE, d MMM yyyy HH:mm:ss Z")> 
20<#assign publicationDate_day = publicationDate?datetime?string["dd"] /> 
21<#assign publicationDate_month = dateUtil.getDate(publicationDate, "MMM", locale)?lower_case /> 
22<#assign publicationDate_year = publicationDate?datetime?string["yy"] /> 
23 
24<#assign hasImage = (image.getData())?? && image.getData() != "" /> 
25<#assign imageUrl = hasImage?string(image.getData(), "")/> 
26<#assign categories = AssetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) /> 
27<#assign hasCategories = categories?has_content /> 
28<#assign viewURL = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() /> 
29 
30<#if hasCategories> 
31    <#assign category = categories[(categories?size-1)] /> 
32    <#assign categoryKey = category.name?lower_case /> 
33    <#assign categoryId = category.categoryId?long /> 
34    <#assign catColor = "#" + getCategoryProperty(categoryId,"color", "000000")/> 
35    <#assign catIcon = getCategoryProperty(categoryId,"icon")/> 
36</#if> 
37 
38<div class="${prefix}-display <#if !hasImage>${prefix}-display--no-image</#if>"> 
39 
40    <#if hasImage> 
41        <#if mostrar_banner?has_content && mostrar_banner.getData() == "sim"> 
42            <div class="${prefix}-page-heading__image ${prefix}-page-heading__image-web-content" 
43                 style="background-color: #ccc; background-image: url('${imageUrl}');" 
44                 alt='${image.getAttribute("alt")}'> 
45 
46                <div class="${prefix}-page-heading__content"> 
47 
48                    <div class="${prefix}-page-heading__breadcrumb"> 
49                        <div class="p-3 p-md-5"> 
50                            <@liferay.breadcrumbs /> 
51                        </div> 
52                    </div> 
53 
54                    <div class="${prefix}-page-heading__overlay"> 
55                    </div> 
56 
57                </div> 
58 
59            </div> 
60        <#else> 
61            <div class="<#if isSchool>${prefix}-page-heading__image ${prefix}-page-heading__image-web-content" 
62                 style="background-color: #ccc; background-image: url('${imageUrl}');</#if>"> 
63                <div class="${prefix}-page-heading__content"> 
64                    <div class="${prefix}-page-heading__breadcrumb"> 
65                        <div class="p-3 p-md-5"> 
66                            <@liferay.breadcrumbs /> 
67                        </div> 
68                    </div> 
69                    <div class="${prefix}-page-heading__overlay"></div> 
70                </div> 
71            </div> 
72        </#if> 
73    </#if> 
74 
75 
76    <div class="${prefix}-display__container"> 
77        <div class="${prefix}-display__header"> 
78            <div class="my-lg-0 mx-lg-auto mx-sm-4"> 
79 
80                <#assign categoryName = ""> 
81                <#list categories as category> 
82                    <#assign categoryName = category.getName() /> 
83                    <#assign categoryKey = categoryName?lower_case /> 
84                </#list> 
85                <#assign hasCategories = categoryName?length gt 0 /> 
86 
87                <#if hasCategories> 
88 
89                    <#if !hasImage> 
90                        <div class="mb-6 ${prefix}-display__container w-100"> 
91                            <#assign schoolURL = themeDisplay.getURLCurrent()?substring(themeDisplay.getURLCurrent()?index_of("/", 2) + 1) /> 
92                            <#assign schoolURL = schoolURL?substring(0, schoolURL?index_of("/")) /> 
93                            <img style="width: 94px;" 
94                                 src="${themeDisplay.getURLPortal()}/webdav/${schoolURL}/document_library/icones-categorias/${catIcon}" 
95                                 alt="Ícone da categoria ${categoryKey}"/> 
96                        </div> 
97                    </#if> 
98 
99                    <div class="${prefix}-display__tag"> 
100                    <#assign categoryKeyClass = categoryKey?replace(" ", "-") /> 
101                        <style> 
102                            .${categoryKeyClass!""} { 
103                                padding-left: 12px; 
104
105 
106                            .${categoryKeyClass!""}:before { 
107                                position: absolute; 
108                                content: ""; 
109                                left: 0; 
110                                top: calc(50% - 3px); 
111                                width: 6px; 
112                                height: 6px; 
113                                border-radius: 3px; 
114                                background-color: ${catColor}; 
115
116 
117                            @media (min-width: 845px) { 
118                                .${categoryKeyClass!""} { 
119                                    padding-left: 18px; 
120
121 
122                                .${categoryKeyClass!""}:before { 
123                                    top: calc(50% - 5px); 
124                                    width: 10px; 
125                                    height: 10px; 
126                                    border-radius: 5px; 
127
128
129                        </style> 
130                        <span title="<@liferay.language key='${prefix}.category' /> ${category.name}" 
131                              class="${prefix}-category position-relative color-black text-uppercase ${categoryKeyClass!""}" 
132                              data-category-key="${categoryKey}"> 
133                                ${categoryName} 
134                            </span> 
135                    </div> 
136                </#if> 
137 
138                <h1> 
139                    ${title.getData()} 
140                </h1> 
141 
142                <h4> 
143                    ${description.getData()} 
144                </h4> 
145 
146                <div class="${prefix}-display__socialmedia"> 
147                    <div class="${prefix}-display__socialmedia-date"> 
148                        <svg 
149                                width="17" 
150                                height="16" 
151                                viewBox="0 0 17 16" 
152                                fill="none" 
153                                xmlns="http://www.w3.org/2000/svg" 
154
155                            <path 
156                                    fill-rule="evenodd" 
157                                    clip-rule="evenodd" 
158                                    d="M0 8C0 3.58172 3.6249 0 8.09644 0C12.568 0 16.1929 3.58172 16.1929 8C16.1929 12.4183 12.568 16 8.09644 16C3.6249 16 0 12.4183 0 8ZM8.09644 1.53672C4.48384 1.53672 1.55525 4.43043 1.55525 8C1.55525 11.5696 4.48384 14.4633 8.09644 14.4633C11.709 14.4633 14.6376 11.5696 14.6376 8C14.6376 4.43043 11.709 1.53672 8.09644 1.53672ZM7.31882 9.67232V4.51977H8.87407V8.13559H11.6186V9.67232H7.31882Z" 
159                                    fill="#C40008" 
160                            /> 
161                        </svg> 
162                        <span class="${prefix}-display__socialmedia-date-span">${publicationDate_day} ${publicationDate_month} ${publicationDate_year}</span> 
163                    </div> 
164 
165                    <div class="${prefix}-display__socialmedia-icons"> 
166 
167                        <div class="${prefix}-display__socialmedia-icons-spacement" 
168                             onclick="share('facebook', '${viewURL}')"> 
169                            <svg width="12" height="21" viewBox="0 0 12 21" fill="none" 
170                                 xmlns="http://www.w3.org/2000/svg"> 
171                                <path d="M2.57027 20.5284H6.86139V11.9355H10.7278L11.1525 7.66546H6.86139V5.50942C6.86139 4.91694 7.3417 4.43664 7.93418 4.43664H11.1525V0.145508H7.93418C4.97177 0.145508 2.57027 2.54701 2.57027 5.50942V7.66546H0.424703L0 11.9355H2.57027V20.5284Z" 
172                                      fill="#B9BDC1"/> 
173                            </svg> 
174                        </div> 
175                        <div class="${prefix}-display__socialmedia-icons-spacement" 
176                             onclick="share('x', '${viewURL}')"> 
177                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" 
178                                 xmlns="http://www.w3.org/2000/svg"> 
179                                <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" 
180                                      fill="#B9BDC1"/> 
181                            </svg> 
182                        </div> 
183                        <!-- div class="${prefix}-display__socialmedia-icons-spacement" onclick="share('instagram','${viewURL}')"> 
184                                <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> 
185                                    <path fill-rule="evenodd" clip-rule="evenodd" d="M10 5.45455C7.48962 5.45455 5.45455 7.48962 5.45455 10C5.45455 12.5104 7.48962 14.5455 10 14.5455C12.5104 14.5455 14.5455 12.5104 14.5455 10C14.5455 7.48962 12.5104 5.45455 10 5.45455ZM7.27273 10C7.27273 11.5062 8.49377 12.7273 10 12.7273C11.5062 12.7273 12.7273 11.5062 12.7273 10C12.7273 8.49377 11.5062 7.27273 10 7.27273C8.49377 7.27273 7.27273 8.49377 7.27273 10Z" fill="#B9BDC1" /> 
186                                    <path d="M15.4545 3.63636C14.9525 3.63636 14.5455 4.04338 14.5455 4.54545C14.5455 5.04753 14.9525 5.45455 15.4545 5.45455C15.9566 5.45455 16.3636 5.04753 16.3636 4.54545C16.3636 4.04338 15.9566 3.63636 15.4545 3.63636Z" fill="#B9BDC1" /> 
187                                    <path fill-rule="evenodd" clip-rule="evenodd" d="M3.63636 0C1.62806 0 0 1.62806 0 3.63636V16.3636C0 18.3719 1.62806 20 3.63636 20H16.3636C18.3719 20 20 18.3719 20 16.3636V3.63636C20 1.62806 18.3719 0 16.3636 0H3.63636ZM16.3636 1.81818H3.63636C2.63221 1.81818 1.81818 2.63221 1.81818 3.63636V16.3636C1.81818 17.3678 2.63221 18.1818 3.63636 18.1818H16.3636C17.3678 18.1818 18.1818 17.3678 18.1818 16.3636V3.63636C18.1818 2.63221 17.3678 1.81818 16.3636 1.81818Z" fill="#B9BDC1" /> 
188                                </svg> 
189                            </div --> 
190                        <div class="${prefix}-display__socialmedia-icons-spacement" 
191                             onclick="share('linkedin','${viewURL}')"> 
192                            <svg width="21" height="21" viewBox="0 0 21 21" fill="none" 
193                                 xmlns="http://www.w3.org/2000/svg"> 
194                                <path d="M3.034 1.06641C1.59036 1.06641 0.646484 2.01437 0.646484 3.26034C0.646484 4.47879 1.56225 5.45379 2.97861 5.45379H3.006C4.47788 5.45379 5.39388 4.47879 5.39388 3.26034C5.36636 2.01437 4.47788 1.06641 3.034 1.06641Z" 
195                                      fill="#B9BDC1"/> 
196                                <path d="M0.894531 7.1875H5.11489V19.8846H0.894531V7.1875Z" fill="#B9BDC1"/> 
197                                <path d="M15.4751 6.88965C13.1983 6.88965 11.6717 9.02903 11.6717 9.02903V7.18765H7.45117V19.8848H11.6714V12.7942C11.6714 12.4146 11.6989 12.0356 11.8104 11.7642C12.1155 11.0062 12.8098 10.2209 13.9758 10.2209C15.5029 10.2209 16.1137 11.3853 16.1137 13.0922V19.8848H20.3337V12.6045C20.3337 8.70447 18.2515 6.88965 15.4751 6.88965Z" 
198                                      fill="#B9BDC1"/> 
199                            </svg> 
200                        </div> 
201                        <div class="${prefix}-display__socialmedia-icons-spacement" 
202                             onclick="share('whatsapp','${title.getData()} ${viewURL}')"> 
203                            <svg width="23" height="23" viewBox="0 0 23 23" fill="none" 
204                                 xmlns="http://www.w3.org/2000/svg"> 
205                                <path fill-rule="evenodd" clip-rule="evenodd" 
206                                      d="M19.1276 3.84157C17.1104 1.82193 14.4276 0.709192 11.5695 0.708008C5.68004 0.708008 0.886915 5.50101 0.884546 11.392C0.883757 13.2752 1.3757 15.1135 2.31077 16.7338L0.794922 22.2705L6.45916 20.7847C8.01988 21.636 9.77697 22.0847 11.5651 22.0852H11.5696C17.4583 22.0852 22.252 17.2918 22.2542 11.4006C22.2554 8.54547 21.1451 5.86108 19.1276 3.84157ZM11.5695 20.2807H11.5658C9.97227 20.2801 8.40944 19.8518 7.04573 19.0428L6.72158 18.8503L3.36034 19.7321L4.2575 16.4549L4.04627 16.1189C3.15727 14.7049 2.68783 13.0706 2.68862 11.3927C2.69046 6.49622 6.67447 2.5126 11.573 2.5126C13.9451 2.51339 16.1749 3.43833 17.8516 5.11698C19.5283 6.79562 20.4511 9.02689 20.4503 11.3999C20.4482 16.2967 16.4644 20.2807 11.5695 20.2807ZM16.4408 13.6295C16.1739 13.4957 14.8612 12.8501 14.6164 12.7608C14.3719 12.6717 14.1937 12.6274 14.0159 12.8946C13.8378 13.1617 13.3263 13.7632 13.1705 13.9412C13.0146 14.1194 12.8591 14.1418 12.592 14.0081C12.325 13.8745 11.4648 13.5925 10.445 12.6829C9.65142 11.975 9.11564 11.1008 8.95982 10.8336C8.80426 10.5662 8.95851 10.4356 9.07695 10.2887C9.36596 9.92985 9.65536 9.55358 9.74433 9.37552C9.83343 9.19732 9.78881 9.04137 9.72196 8.90779C9.65536 8.77421 9.12144 7.46011 8.89902 6.92539C8.68213 6.40501 8.46222 6.47529 8.29823 6.46713C8.14267 6.45937 7.96461 6.45779 7.78655 6.45779C7.60861 6.45779 7.31934 6.52451 7.07455 6.79194C6.82989 7.05923 6.14027 7.70503 6.14027 9.01913C6.14027 10.3332 7.09692 11.6027 7.23037 11.7809C7.36382 11.9591 9.11301 14.6557 11.7911 15.812C12.4281 16.0873 12.9253 16.2515 13.3131 16.3745C13.9527 16.5777 14.5346 16.549 14.9947 16.4803C15.5077 16.4036 16.5741 15.8344 16.7968 15.2108C17.0192 14.5872 17.0192 14.0527 16.9523 13.9412C16.8857 13.8299 16.7077 13.7632 16.4408 13.6295Z" 
207                                      fill="#B9BDC1" stroke="#B9BDC1" stroke-width="0.3"/> 
208                            </svg> 
209                        </div> 
210 
211                    </div> 
212 
213                </div> 
214 
215            </div> 
216 
217        </div> 
218        <div class="${prefix}-display__newscontent"> 
219            ${content.getData()} 
220        </div> 
221 
222 
223    </div> 
224 
225</div> 
226 
227<!-- Related Links --> 
228<#if relatedLink??  && relatedLink.relatedLinkTitle.getData()?has_content> 
229    <#if relatedLink.getSiblings()?has_content> 
230 
231        <div class="mt-4 mb-5"> 
232            <div class="mpsp-section-title mb-5 w-100"> 
233                <h3>Links Relacionados:</h3> 
234            </div> 
235            <div class="mpsp-category-navigation d-flex flex-wrap mx-n3 my-n2"> 
236 
237                <#list relatedLink.getSiblings() as cur_relatedLink> 
238 
239                    <div class="mpsp-category-navigation__item d-md-flex flex-wrap mx-3 my-2"> 
240                        <div class="text-center"> 
241                            <a class="mpsp-button mpsp-button--red mpsp-button--outline text-spaced text-uppercase" 
242                               href="${cur_relatedLink.getData()}" 
243                               target="blank">${cur_relatedLink.relatedLinkTitle.getData()}</a> 
244                        </div> 
245                    </div> 
246 
247                </#list> 
248 
249            </div> 
250        </div> 
251 
252    </#if> 
253</#if> 
254 
255<!-- Related Files --> 
256<#if relatedFile?? && relatedFile.relatedFileTitle.getData()?has_content> 
257    <#if relatedFile.getSiblings()?has_content> 
258 
259        <div class="mt-5 mb-5"> 
260 
261            <div class="mpsp-section-title mb-5 mt-4 w-100"> 
262                <h3>Arquivos Relacionados: </h3> 
263            </div> 
264            <div class="mpsp-category-navigation d-flex flex-wrap mx-n3 my-n2"> 
265 
266                <#list relatedFile.getSiblings() as cur_relatedFile> 
267 
268                    <div class="mpsp-category-navigation__item d-md-flex flex-wrap mx-3 my-2"> 
269 
270                        <div class="text-center"> 
271                            <a class="mpsp-button mpsp-button--red mpsp-button--outline text-spaced text-uppercase" 
272                               href="${cur_relatedFile.getData()}&download=true" 
273                               target="_blank">${cur_relatedFile.relatedFileTitle.getData()}</a> 
274                        </div> 
275 
276                    </div> 
277 
278                </#list> 
279 
280            </div> 
281 
282        </div> 
283 
284    </#if> 
285</#if> 
286 
287 
288</div> 

Notícias relacionadas