@@ -2,9 +2,9 @@ import { EntryModel } from "."
2
2
3
3
export function addTags ( entry : EntryModel , contentTypeUid : string , tagsAsObject : boolean , locale : string = 'en-us' ) : void {
4
4
if ( entry ) {
5
- const appliedVariants = entry . _applied_variants || null ;
6
- entry . $ = getTag ( entry , `${ contentTypeUid } .${ entry . uid } .${ locale } ` , tagsAsObject , locale , { _applied_variants : appliedVariants , shouldApplyVariant : ! ! appliedVariants , metaKey : '' } ) }
7
- }
5
+ const appliedVariants = entry . _applied_variants || entry ?. system ?. applied_variants || null ;
6
+ entry . $ = getTag ( entry , `${ contentTypeUid } .${ entry . uid } .${ locale } ` , tagsAsObject , locale , { _applied_variants : appliedVariants , shouldApplyVariant : ! ! appliedVariants , metaKey : '' } ) }
7
+ }
8
8
9
9
function getTag ( content : object , prefix : string , tagsAsObject : boolean , locale : string , appliedVariants : { _applied_variants :{ [ key : string ] : any } , shouldApplyVariant : boolean , metaKey : string } ) : object {
10
10
const tags : any = { }
@@ -48,7 +48,7 @@ import { EntryModel } from "."
48
48
* }]
49
49
* }
50
50
*/
51
- const newAppliedVariants = obj . _applied_variants || _applied_variants ;
51
+ const newAppliedVariants = obj . _applied_variants || obj ?. system ?. applied_variants || _applied_variants ;
52
52
const newShouldApplyVariant = ! ! newAppliedVariants
53
53
value [ index ] . $ = getTag ( obj , `${ obj . _content_type_uid } .${ obj . uid } .${ obj . locale || locale } ` , tagsAsObject , locale , { _applied_variants :newAppliedVariants , shouldApplyVariant :newShouldApplyVariant , metaKey : "" } )
54
54
} else if ( typeof obj === "object" ) {
0 commit comments