File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/lib/UI/Config/Provider/Module Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,17 @@ private function getImageConfig(): array
100100 {
101101 $ imageConfig = [
102102 'showImageFilters ' => $ this ->showImageFilters (),
103- 'aggregations ' => $ this ->config ['image ' ]['aggregations ' ],
104103 'enableMultipleDownload ' => extension_loaded ('zip ' ),
105104 ];
106105
106+ // The content type may not have the default fields; in that case, don't add the aggregations
107+ $ imageType = $ this ->contentTypeService ->loadContentTypeByIdentifier ('image ' );
108+ foreach ($ this ->config ['image ' ]['aggregations ' ] as $ aggregation ) {
109+ if ($ imageType ->hasFieldDefinition ($ aggregation ['fieldDefinitionIdentifier ' ])) {
110+ $ imageConfig ['aggregations ' ][] = $ aggregation ;
111+ }
112+ }
113+
107114 $ mappings = [];
108115 $ contentTypeIdentifiers = [];
109116 $ fieldDefinitionIdentifiers = [];
You can’t perform that action at this time.
0 commit comments