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 95, column 29]
----
1<#assign prefix = "mpsp"/> 
2 
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
4<#assign AssetCategoryPropService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") /> 
5<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
6<#assign journalArticle = JournalArticleLocalService.getArticle(getterUtil.getLong(groupId),.vars['reserved-article-id'].data) /> 
7<#assign GroupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") /> 
8<#assign schoolGroup = GroupLocalService.getGroup(user.getCompanyId(), "MPSP - Escola") /> 
9<#assign isSchool = themeDisplay.getScopeGroupId() != schoolGroup.getGroupId() /> 
10 
11<#assign originalLocale = .locale> 
12<#setting locale = localeUtil.getDefault()> 
13<#assign publicationDate = .vars['reserved-article-display-date'].data /> 
14<#assign publicationDate = publicationDate?datetime("EEE, d MMM yyyy HH:mm:ss Z")> 
15<#assign publicationDate_day = publicationDate?datetime?string["dd"] /> 
16<#assign publicationDate_month = dateUtil.getDate(publicationDate, "MMM", locale)?lower_case /> 
17<#assign publicationDate_year = publicationDate?datetime?string["yy"] /> 
18 
19<#assign hasImage = (image.getData())?? && image.getData() != "" /> 
20<#assign imageUrl = hasImage?string(image.getData(), "")/> 
21<#assign categories = AssetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) /> 
22<#assign hasCategories = categories?has_content /> 
23<#assign viewURL = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() /> 
24 
25<#if hasCategories> 
26    <#assign category = categories[(categories?size-1)] /> 
27    <#assign categoryKey = category.name?lower_case /> 
28    <#assign categoryId = category.categoryId?long /> 
29    <#attempt> 
30        <#assign catColor = "#" + AssetCategoryPropService.getCategoryProperty(categoryId,"color").value/> 
31        <#recover> 
32            <#assign catColor = '#000000' /> 
33    </#attempt> 
34    <#attempt> 
35        <#assign catIcon = AssetCategoryPropService.getCategoryProperty(categoryId,"icon").value/> 
36        <#recover> 
37            <#assign catIcon = '' /> 
38    </#attempt> 
39</#if> 
40 
41<div class="${prefix}-display <#if !hasImage>${prefix}-display--no-image</#if>"> 
42 
43    <#if hasImage> 
44        <#if mostrar_banner?has_content && mostrar_banner.getData() == "sim"> 
45            <div class="${prefix}-page-heading__image ${prefix}-page-heading__image-web-content" 
46                 style="background-color: #ccc; background-image: url('${imageUrl}');" 
47                 alt='${image.getAttribute("alt")}'> 
48 
49                <div class="${prefix}-page-heading__content"> 
50 
51                    <div class="${prefix}-page-heading__breadcrumb"> 
52                        <div class="p-3 p-md-5"> 
53                            <@liferay.breadcrumbs /> 
54                        </div> 
55                    </div> 
56 
57                    <div class="${prefix}-page-heading__overlay"> 
58                    </div> 
59 
60                </div> 
61 
62            </div> 
63        <#else> 
64            <div class="<#if isSchool>${prefix}-page-heading__image ${prefix}-page-heading__image-web-content" 
65                 style="background-color: #ccc; background-image: url('${imageUrl}');</#if>"> 
66                <div class="${prefix}-page-heading__content"> 
67                    <div class="${prefix}-page-heading__breadcrumb"> 
68                        <div class="p-3 p-md-5"> 
69                            <@liferay.breadcrumbs /> 
70                        </div> 
71                    </div> 
72                    <div class="${prefix}-page-heading__overlay"></div> 
73                </div> 
74            </div> 
75        </#if> 
76    </#if> 
77 
78 
79    <div class="${prefix}-display__container"> 
80        <div class="${prefix}-display__header"> 
81            <div class="my-lg-0 mx-lg-auto mx-sm-4"> 
82 
83                <#assign categoryName = ""> 
84                <#list categories as category> 
85                    <#assign categoryName = category.getName() /> 
86                    <#assign categoryKey = categoryName?lower_case /> 
87                </#list> 
88                <#assign hasCategories = categoryName?length gt 0 /> 
89 
90                <#if hasCategories> 
91 
92                    <#if !hasImage> 
93                        <div class="mb-6 ${prefix}-display__container w-100"> 
94                            <#assign schoolURL = themeDisplay.getURLCurrent()?substring(themeDisplay.getURLCurrent()?index_of("/", 2) + 1) /> 
95                            <#assign schoolURL = schoolURL?substring(0, schoolURL?index_of("/")) /> 
96                            <img style="width: 94px;" 
97                                 src="${themeDisplay.getURLPortal()}/webdav/${schoolURL}/document_library/icones-categorias/${catIcon}" 
98                                 alt="Ícone da categoria ${categoryKey}"/> 
99                        </div> 
100                    </#if> 
101 
102                    <div class="${prefix}-display__tag"> 
103                    <#assign categoryKeyClass = categoryKey?replace(" ", "-") /> 
104                        <style> 
105                            .${categoryKeyClass!""} { 
106                                padding-left: 12px; 
107
108 
109                            .${categoryKeyClass!""}:before { 
110                                position: absolute; 
111                                content: ""; 
112                                left: 0; 
113                                top: calc(50% - 3px); 
114                                width: 6px; 
115                                height: 6px; 
116                                border-radius: 3px; 
117                                background-color: ${catColor}; 
118
119 
120                            @media (min-width: 845px) { 
121                                .${categoryKeyClass!""} { 
122                                    padding-left: 18px; 
123
124 
125                                .${categoryKeyClass!""}:before { 
126                                    top: calc(50% - 5px); 
127                                    width: 10px; 
128                                    height: 10px; 
129                                    border-radius: 5px; 
130
131
132                        </style> 
133                        <span title="<@liferay.language key='${prefix}.category' /> ${category.name}" 
134                              class="${prefix}-category position-relative color-black text-uppercase ${categoryKeyClass!""}" 
135                              data-category-key="${categoryKey}"> 
136                                ${categoryName} 
137                            </span> 
138                    </div> 
139                </#if> 
140 
141                <h1> 
142                    ${title.getData()} 
143                </h1> 
144 
145                <h4> 
146                    ${description.getData()} 
147                </h4> 
148 
149                <div class="${prefix}-display__socialmedia"> 
150                    <div class="${prefix}-display__socialmedia-date"> 
151                        <svg 
152                                width="17" 
153                                height="16" 
154                                viewBox="0 0 17 16" 
155                                fill="none" 
156                                xmlns="http://www.w3.org/2000/svg" 
157
158                            <path 
159                                    fill-rule="evenodd" 
160                                    clip-rule="evenodd" 
161                                    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" 
162                                    fill="#C40008" 
163                            /> 
164                        </svg> 
165                        <span class="${prefix}-display__socialmedia-date-span">${publicationDate_day} ${publicationDate_month} ${publicationDate_year}</span> 
166                    </div> 
167 
168                    <div class="${prefix}-display__socialmedia-icons"> 
169 
170                        <div class="${prefix}-display__socialmedia-icons-spacement" 
171                             onclick="share('facebook', '${viewURL}')"> 
172                            <svg width="12" height="21" viewBox="0 0 12 21" fill="none" 
173                                 xmlns="http://www.w3.org/2000/svg"> 
174                                <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" 
175                                      fill="#B9BDC1"/> 
176                            </svg> 
177                        </div> 
178                        <div class="${prefix}-display__socialmedia-icons-spacement" 
179                             onclick="share('twitter', '${viewURL}')"> 
180                            <svg width="13" height="20" viewBox="0 0 13 20" fill="none" 
181                                 xmlns="http://www.w3.org/2000/svg"> 
182                                <path fill-rule="evenodd" clip-rule="evenodd" 
183                                      d="M2.25103 0.145508C3.43599 0.145508 4.3966 1.10611 4.3966 2.29107V5.50942H10.8333C12.0182 5.50942 12.9789 6.47002 12.9789 7.65498C12.9789 8.83994 12.0182 9.80054 10.8333 9.80054H4.3966V11.9461C4.3966 13.7236 5.8375 15.1645 7.61494 15.1645H10.8333C12.0182 15.1645 12.9789 16.1251 12.9789 17.31C12.9789 18.495 12.0182 19.4556 10.8333 19.4556H7.61494C3.46757 19.4556 0.105469 16.0935 0.105469 11.9461V2.29107C0.105469 1.10611 1.06607 0.145508 2.25103 0.145508Z" 
184                                      fill="#B9BDC1"/> 
185                            </svg> 
186                        </div> 
187                        <!-- div class="${prefix}-display__socialmedia-icons-spacement" onclick="share('instagram','${viewURL}')"> 
188                                <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> 
189                                    <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" /> 
190                                    <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" /> 
191                                    <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" /> 
192                                </svg> 
193                            </div --> 
194                        <div class="${prefix}-display__socialmedia-icons-spacement" 
195                             onclick="share('linkedin','${viewURL}')"> 
196                            <svg width="21" height="21" viewBox="0 0 21 21" fill="none" 
197                                 xmlns="http://www.w3.org/2000/svg"> 
198                                <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" 
199                                      fill="#B9BDC1"/> 
200                                <path d="M0.894531 7.1875H5.11489V19.8846H0.894531V7.1875Z" fill="#B9BDC1"/> 
201                                <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" 
202                                      fill="#B9BDC1"/> 
203                            </svg> 
204                        </div> 
205                        <div class="${prefix}-display__socialmedia-icons-spacement" 
206                             onclick="share('whatsapp','${title.getData()} ${viewURL}')"> 
207                            <svg width="23" height="23" viewBox="0 0 23 23" fill="none" 
208                                 xmlns="http://www.w3.org/2000/svg"> 
209                                <path fill-rule="evenodd" clip-rule="evenodd" 
210                                      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" 
211                                      fill="#B9BDC1" stroke="#B9BDC1" stroke-width="0.3"/> 
212                            </svg> 
213                        </div> 
214 
215                    </div> 
216 
217                </div> 
218 
219            </div> 
220 
221        </div> 
222     
223 
224        <div class="${prefix}-display__newscontent"> 
225            ${content.getData()} 
226        </div> 
227 
228 
229    </div> 
230 
231</div> 
232 
233<!-- Related Links --> 
234<#if relatedLink??  && relatedLink.relatedLinkTitle.getData()?has_content> 
235    <#if relatedLink.getSiblings()?has_content> 
236 
237        <div class="mt-4 mb-5"> 
238            <div class="mpsp-section-title mb-5 w-100"> 
239                <h3>Links Relacionados:</h3> 
240            </div> 
241            <div class="mpsp-category-navigation d-flex flex-wrap mx-n3 my-n2"> 
242 
243                <#list relatedLink.getSiblings() as cur_relatedLink> 
244 
245                    <div class="mpsp-category-navigation__item d-md-flex flex-wrap mx-3 my-2"> 
246                        <div class="text-center"> 
247                            <a class="mpsp-button mpsp-button--red mpsp-button--outline text-spaced text-uppercase" 
248                               href="${cur_relatedLink.getData()}" 
249                               target="blank">${cur_relatedLink.relatedLinkTitle.getData()}</a> 
250                        </div> 
251                    </div> 
252 
253                </#list> 
254 
255            </div> 
256        </div> 
257 
258    </#if> 
259</#if> 
260 
261<!-- Related Files --> 
262<#if relatedFile?? && relatedFile.relatedFileTitle.getData()?has_content> 
263    <#if relatedFile.getSiblings()?has_content> 
264 
265        <div class="mt-5 mb-5"> 
266 
267            <div class="mpsp-section-title mb-5 mt-4 w-100"> 
268                <h3>Arquivos Relacionados: </h3> 
269            </div> 
270            <div class="mpsp-category-navigation d-flex flex-wrap mx-n3 my-n2"> 
271 
272                <#list relatedFile.getSiblings() as cur_relatedFile> 
273 
274                    <div class="mpsp-category-navigation__item d-md-flex flex-wrap mx-3 my-2"> 
275 
276                        <div class="text-center"> 
277                            <a class="mpsp-button mpsp-button--red mpsp-button--outline text-spaced text-uppercase" 
278                               href="${cur_relatedFile.getData()}&download=true" 
279                               target="_blank">${cur_relatedFile.relatedFileTitle.getData()}</a> 
280                        </div> 
281 
282                    </div> 
283 
284                </#list> 
285 
286            </div> 
287 
288        </div> 
289 
290    </#if> 
291</#if> 
292 
293 
294</div> 

Notícias relacionadas