null The House of the Hungarian Parliament

An error occurred while processing the template.
?substring(...) argument #2 had invalid value: The index mustn't be greater than the length of the string, 0, but it was 2.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${curItem.languageSelector.getData()?...  [in template "10154#10194#891993" at line 71, column 92]
	- Reached through: #assign languageArrayToManageComma = ...  [in template "10154#10194#891993" at line 71, column 23]
----
1<#--FACEBOOK LIKE/SHARE SCRIPT--> 
2<div id="fb-root"></div> 
3<script>(function(d, s, id) { 
4    var js, fjs = d.getElementsByTagName(s)[0]; 
5    if (d.getElementById(id)) return; 
6    js = d.createElement(s); js.id = id; 
7    js.src = 'https://connect.facebook.net/${locale}/sdk.js#xfbml=1&version=v3.2'; 
8    fjs.parentNode.insertBefore(js, fjs); 
9  }(document, 'script', 'facebook-jssdk'));</script> 
10 
11<#--TO GET THE IMAGE PATH FROM THEME--> 
12<#assign imagesPath = themeDisplay.getPathThemeImages()/> 
13<#assign urlBase = themeDisplay.getPathFriendlyURLPublic()+themeDisplay.getScopeGroup().getFriendlyURL()/> 
14 
15<#assign journalArticleId = .vars['reserved-article-id'].data/> 
16 
17<#-- PDF VIEWER --> 
18<#if .vars['flipPageContent'].getData() != ""> 
19  <div id="flipbookContainer_${randomNamespace}"></div> 
20  <script> 
21    jQuery(document).ready(function () { 
22      var options_${randomNamespace} = dflip_add_default_options( 
23
24            height: 500, 
25            scrollWheel: false, 
26
27      ); 
28      var flipBook_${randomNamespace} = jQuery("#flipbookContainer_${randomNamespace}").flipBook("${.vars['flipPageContent'].getData()}", options_${randomNamespace}); 
29    }); 
30  </script> 
31</#if> 
32 
33 
34<div> 
35  <h2>${.vars['bookTitle'].getData()}</h2> 
36  <p>${.vars['description'].getData()}<br><br> 
37      <@liferay.language key="release-date" />: ${.vars['releaseDate'].getData()}<br> 
38      <@liferay.language key="number-of-pages" />: ${.vars['pageCount'].getData()}<br> 
39      <@liferay.language key="size" />: ${.vars['size'].getData()}<br> 
40      <@liferay.language key="book-cover" />: ${.vars['binding'].getData()}<br> 
41    ISBN: ${.vars['isbn'].getData()}<br> 
42    ISSN: ${.vars['issn'].getData()}<br> 
43 
44      <#-- MAKING UNIQUE BOOK PRICE ARRAY --> 
45      <#assign uniquePriceArray = []> 
46      <#list .vars['enableLanguage'].getSiblings() as curItem> 
47          <#if curItem.getData() == "true"> 
48              <#assign curPrice = curItem.price.getData()> 
49              <#assign uniquePrice = true> 
50              <#list uniquePriceArray as curPriceOfTheArray> 
51                  <#if curPriceOfTheArray == curPrice> 
52                      <#assign uniquePrice = false> 
53                      <#break> 
54                  </#if> 
55              </#list> 
56              <#if uniquePrice> 
57                  <#assign uniquePriceArray = uniquePriceArray + [curPrice]> 
58              </#if> 
59          </#if> 
60      </#list> 
61 
62 
63      <#-- LISTING THE PRICES WITH THE ASSOCIATED LANGUAGES --> 
64    <strong><@liferay.language key="publisher-price" />:</strong><br> 
65      <#list uniquePriceArray as curPriceOfTheArray> 
66          <#if curPriceOfTheArray != ""> 
67              <#assign languageArrayToManageComma = []> 
68 
69              <#list .vars['enableLanguage'].getSiblings() as curItem> 
70                  <#if curItem.getData() == "true" && curPriceOfTheArray == curItem.price.getData()> 
71                      <#assign languageArrayToManageComma = languageArrayToManageComma + ["${curItem.languageSelector.getData()?substring(0, 2)}"]> 
72                  </#if> 
73              </#list> 
74 
75              <#assign i = 0> 
76              <#assign languageCount = languageArrayToManageComma?size> 
77              <@compress single_line=true> 
78                  <#list languageArrayToManageComma as languageLabel> 
79                      <#assign lang = languageUtil.get(locale, "language.${languageLabel}")> 
80                      <#if locale == "hu_HU"> 
81                          <#assign lang = lang?lower_case /> 
82                      </#if> 
83                      ${lang}<#if i < languageCount - 1>, </#if><#assign i = i + 1></#list>: <strong>${curPriceOfTheArray} Ft</strong> 
84              </@compress> 
85            </br> 
86          </#if> 
87      </#list> 
88    <br> 
89 
90 
91      <#-- MAKING AN ARRAY FROM THE LANGUAGE DATAS TO USE IT FOR THE CART POPUP --> 
92      <#assign languageDataForPopup = []> 
93      <#list .vars['enableLanguage'].getSiblings() as curItem> 
94          <#if curItem.getData() == "true"> 
95              <#assign languageCode = curItem.languageSelector.getData()> 
96              <#assign shortenedLanguageCode = languageCode?substring(0, 2)> 
97              <#assign imgUrl = imagesPath + "/language/" + languageCode + ".png"> 
98              <#assign bookPrice = curItem.price.getData()> 
99              <#assign languageDataForPopup = languageDataForPopup + [{'code': '${languageCode}', 'label': '${shortenedLanguageCode}', 'img': '${imgUrl}', 'price': '${bookPrice}'}]> 
100          </#if> 
101      </#list> 
102 
103    <a 
104        href="#myModal" 
105        role="button" 
106        class="btn btn-primary konvy-kosarba" 
107        data-toggle="modal" 
108        data-book-title = "${.vars['bookTitle'].getData()}" 
109        data-friendly-url-prefix = "${urlBase}/kosar/-/konyvkosar/betesz/${journalArticleId}/" 
110            <#assign i = 0> 
111            <#assign dataCount = languageDataForPopup?size> 
112        data-languages='[<#list languageDataForPopup as languageData>{&quot;code&quot;:&quot;${languageData['code']}&quot;, &quot;label&quot;:&quot;<@liferay.language key="language.${languageData['label']}"/>", &quot;img&quot;:&quot;${languageData['img']}&quot;, &quot;price&quot;:&quot;${languageData['price']}&quot;}<#if i < dataCount - 1>,</#if><#assign i = i + 1></#list>]' 
113    ><@liferay.language key="book-this-item" /></a> 
114  </p> 
115</div> 
116 
117<#--FACEBOOK LIKE/SHARE DISPLAY--> 
118<#assign absoluteUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent()> 
119<div class="fb-like" data-href="${absoluteUrl}" data-layout="button" data-action="like" data-size="small" data-share="true"></div>