File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,15 @@ public function augment($values)
119119 {
120120 $ single = $ this ->config ('max_items ' ) === 1 ;
121121
122- if ($ single && Blink::has ($ key = 'terms-augment- ' .json_encode ($ values ))) {
122+ // The parent is the item this terms fieldtype exists on. Most commonly an
123+ // entry, but could also be something else, like another taxonomy term.
124+ $ parent = $ this ->field ->parent ();
125+
126+ $ site = $ parent && $ parent instanceof Localization
127+ ? $ parent ->locale ()
128+ : Site::current ()->handle (); // Use the "current" site so this will get localized appropriately on the front-end.
129+
130+ if ($ single && Blink::has ($ key = 'terms-augment- ' .$ site .'- ' .json_encode ($ values ))) {
123131 return Blink::get ($ key );
124132 }
125133
You can’t perform that action at this time.
0 commit comments