Safe checking of metadtumList in item page.

This commit is contained in:
mateuswetah 2022-09-08 10:04:17 -03:00
parent 2ae1ef8d56
commit d653ddf4d6
2 changed files with 47 additions and 45 deletions

View File

@ -102,6 +102,7 @@
</span>
</label>
</div>
<template v-if="metadatumList && Array.isArray(metadatumList)">
<div
v-for="(itemMetadatum, index) of metadatumList.filter(anItemMetadatum => anItemMetadatum.metadatum.metadata_section_id == metadataSection.id)"
:key="index"
@ -126,6 +127,7 @@
</div>
</div>
<br>
</template>
</div>
</div>

View File

@ -463,7 +463,7 @@
v-if="metadataSection.description && (!hideHelpButtons && helpInfoBellowLabel)">
{{ metadataSection.description }}
</p>
<template v-if="metadatumList && Array.isArray(metadatumList)">
<template v-for="(itemMetadatum, index) of metadatumList.filter(anItemMetadatum => anItemMetadatum.metadatum.metadata_section_id == metadataSection.id)">
<!-- JS-side hook for extra content -->
@ -488,7 +488,7 @@
class="item-submission-hook item-submission-hook-metadatum-after"
v-html="getAfterHook('metadatum', { metadatum: itemMetadatum.metadatum, index: index, metadataSection: metadataSection, sectionIndex: sectionIndex })" />
</template>
</template>
<!-- JS-side hook for extra content -->
<div
v-if="hasAfterHook('metadata_section')"