Se ha producido un error al procesar la plantilla.
Negative range end index (-2) isn't allowed for a range used for slicing.
The blamed expression:
==> indexCategoryId..currentUrl?index_of("?") -1  [in template "20115#20151#36615" at line 11, column 38]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign categoryId = currentUrl[index...  [in template "20115#20151#36615" at line 11, column 5]
----
1<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />  
2<#assign friendlyURL = themeDisplay.getPathFriendlyURLPublic() + themeDisplay.getScopeGroup().getFriendlyURL() /> 
3<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") > 
4<#assign dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") /> 
5<#assign categoryId = "" /> 
6<#assign categoryName = "" /> 
7 
8<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() /> 
9<#if currentUrl?contains("/categories/")> 
10    <#assign indexCategoryId = currentUrl?last_index_of("/") + 1 /> 
11    <#assign categoryId = currentUrl[indexCategoryId..currentUrl?index_of("?") -1 ] /> 
12</#if> 
13 
14<#if entries?has_content> 
15<section class="mj-section"> 
16    <div class="gridContainer mj-container"> 
17	<article class="mj-article"> 
18        <div class="row"> 
19            <div class="col-md-12"> 
20				<#if categoryId?? && categoryId?has_content && categoryId != ''> 
21					<#assign category = assetCategoryLocalService.getAssetCategory(categoryId?number) /> 
22					<#assign categoryName = category.getName() /> 
23				   <span> Año ${categoryName} </span> 
24				</#if> 
25				<h2 class="mj-article__title">Lista de Fiscales Generales del Estado</h2> 
26				<div class="row"> 
27					<div class="mj-box--flex-tiles clearfix"> 
28					<#list entries as curEntry> 
29						<#assign article = journalArticleLocalService.fetchLatestArticle(curEntry.getClassPK()) /> 
30						<#assign articleXML = saxReaderUtil.read(article.getContent()) /> 
31						<#assign name = article.getTitle(locale) /> 
32						<#assign fechaNombramiento = articleXML.valueOf("//dynamic-element[@name='FechaDeNombramiento']/dynamic-content/text()") /> 
33						<#assign fechaCese = articleXML.valueOf("//dynamic-element[@name='FechaDeCese']/dynamic-content/text()") /> 
34							<div class="col-xs-12 col-sm-6 col-md-3"> 
35								<div class="mj-box-people"> 
36									<#assign pictureAttributesKeyValue = { "class": "mj-box-people__fig"} /> 
37									<#assign imgAttributesKeyValue = { "class": "mj-box-people__img", "alt": "" } /> 
38									<#assign imgHtml = customAmImageUtil.createAMImageByAssetClassPkOfJournalArticle(curEntry.classPK,"Imagen",100,locale,pictureAttributesKeyValue,imgAttributesKeyValue)/> 
39									${imgHtml} 
40									<div class="mj-box-people__info"> 
41										<a href="${friendlyURL}/-/${article.getUrlTitle()}" class="mj-box-people__txt mj-box-people__txt--bold">${name}</a> 
42										 
43										<div class="mj-box-people__txt"> 
44											<p class="mb-1"><strong>Nombramiento: </strong>${customDate(fechaNombramiento)}</p><p> 
45											 <#if fechaCese != "" > 
46												<strong>Cese: </strong>${customDate(fechaCese)}</p> 
47											</#if> 
48										</div> 
49									</div> 
50								</div> 
51							</div> 
52					</#list> 
53					</div> 
54				</div> 
55            </div> 
56        </div> 
57	</article> 
58    </div>                 
59</section> 
60<#else> 
61<section class="mj-section"> 
62    <div class="gridContainer mj-container"> 
63<p class="mj-box--flex-tiles">No hay resultados</p> 
64</div> 
65</section> 
66</#if> 
67 
68<#function customDate dateString > 
69	<#assign customDateFormat = ""> 
70 
71	<#if validator.isNotNull(dateString)> 
72		<#assign dateObj = dateUtil.parseDate("yyyy-MM-dd", dateString, locale) /> 
73		<#assign customDateObj = dateUtil.getDate(dateObj, "dd'/'MM'/'yyyy", locale) /> 
74		<#assign customDateFormat = customDateObj /> 
75	<#else> 
76		<#assign customDateFormat = ""> 
77	</#if> 
78 
79  <#return customDateFormat > 
80</#function> 
81 
82<script type="text/javascript"> 
83    var category = '${categoryName}' ; 
84    if (category != "") { 
85        $("span.selected").html(category); 
86
87</script>