diff --git a/public/js/pimcore/object/tags/fieldcollections.js b/public/js/pimcore/object/tags/fieldcollections.js
index 583817c2ef..145e9dcb7c 100644
--- a/public/js/pimcore/object/tags/fieldcollections.js
+++ b/public/js/pimcore/object/tags/fieldcollections.js
@@ -48,11 +48,62 @@ pimcore.object.tags.fieldcollections = Class.create(pimcore.object.tags.abstract
return {text: t(field.label), width: 150, sortable: false, dataIndex: field.key,
renderer: function (key, value, metaData, record) {
this.applyPermissionStyle(key, value, metaData, record);
+ if(typeof record.data[key] === 'string') {
+ return record.data[key];
+ }
+
+ let preview = '';
+ let plainText = false;
+ let fieldCollectionItems = record.data[key];
+
+ if (typeof record.data.preview !== 'undefined'){
+ fieldCollectionItems = record.data.preview;
+ plainText = true;
+ }
+
+ let previousFieldCollectionItemType = null;
+ for (let fieldCollectionItem of fieldCollectionItems) {
+
+ if (plainText) {
+ preview += this.generatePlainTextPreview(fieldCollectionItem);
+ } else {
+ if (previousFieldCollectionItemType !== fieldCollectionItem.type) {
+ preview += `
${t(fieldCollectionItem.type)}
`;
+ previousFieldCollectionItemType = fieldCollectionItem.type;
+ }
+
+ preview += ``;
+ for (let fieldKey in fieldCollectionItem.data) {
+ if (!fieldCollectionItem.data.hasOwnProperty(fieldKey)) {
+ continue;
+ }
+
+ preview += `
${t(fieldCollectionItem.data[fieldKey].title)}:
`;
+ preview += `
${fieldCollectionItem.data[fieldKey].value ? fieldCollectionItem.data[fieldKey].value : '-'}
`;
+ }
+ preview += `
`;
+ }
+ }
- return t("not_supported");
+ return preview;
}.bind(this, field.key)};
},
+ generatePlainTextPreview: function (fieldCollectionItem) {
+ let preview = `${t(fieldCollectionItem.type)} - `;
+ for (let fieldKey in fieldCollectionItem.data) {
+ if (!fieldCollectionItem.data.hasOwnProperty(fieldKey)) {
+ continue;
+ }
+ preview += `${t(fieldCollectionItem.data[fieldKey].title)}:
`;
+ if (fieldCollectionItem.data[fieldKey].value) {
+ preview += `${Ext.util.Format.stripTags(fieldCollectionItem.data[fieldKey].value)}`;
+ }else{
+ preview += '-';
+ }
+ }
+ return preview;
+ },
loadFieldDefinitions: function () {
var allowedTypes = this.fieldConfig.allowedTypes;
diff --git a/src/Service/GridData/DataObject.php b/src/Service/GridData/DataObject.php
index 9757cc95c1..1e58e09875 100644
--- a/src/Service/GridData/DataObject.php
+++ b/src/Service/GridData/DataObject.php
@@ -280,7 +280,7 @@ private static function getValueForObject(Concrete $object, string $key, string
$fieldDefinition = $brickClass->getFieldDefinition($brickKey, $context);
}
- if ($fieldDefinition->isEmpty($value)) {
+ if ($fieldDefinition->isEmpty($value) && $fieldDefinition->supportsInheritance()) {
$parent = Service::hasInheritableParentObject($object);
if (!empty($parent)) {
return self::getValueForObject($parent, $key, $brickType, $brickKey, $fieldDefinition, $context, $brickDescriptor);