File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -63,18 +63,17 @@ private function addToMap(Context $context): array
6363 foreach ($ context ->endpoints ($ collection ) as $ endpoint ) {
6464 if ($ endpoint instanceof ProvidesResourceLinks) {
6565 foreach ($ endpoint ->resourceLinks ($ collectionContext ) as $ field ) {
66- $ linkFieldsCache [$ type ][$ field ->name ] ??= [
67- $ field ,
68- $ collectionContext ,
69- ];
66+ $ linkFieldsCache [$ type ][$ field ->name ] ??= [$ field , $ collection ];
7067 }
7168 }
7269 }
7370 }
7471 }
7572
76- foreach ($ linkFieldsCache [$ type ] ?? [] as [$ field , $ collectionContext ]) {
77- if (!$ field ->isVisible ($ linkContext = $ collectionContext ->withField ($ field ))) {
73+ foreach ($ linkFieldsCache [$ type ] ?? [] as [$ field , $ collection ]) {
74+ $ linkContext = $ context ->withCollection ($ collection )->withField ($ field );
75+
76+ if (!$ field ->isVisible ($ linkContext )) {
7877 continue ;
7978 }
8079
You can’t perform that action at this time.
0 commit comments