File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,18 @@ 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 ] ??= $ field ;
66+ $ linkFieldsCache [$ type ][$ field ->name ] ??= [
67+ $ field ,
68+ $ collectionContext ,
69+ ];
6770 }
6871 }
6972 }
7073 }
7174 }
7275
73- foreach ($ linkFieldsCache [$ type ] ?? [] as $ field ) {
74- if (!$ field ->isVisible ($ linkContext = $ context ->withField ($ field ))) {
76+ foreach ($ linkFieldsCache [$ type ] ?? [] as [ $ field, $ collectionContext ] ) {
77+ if (!$ field ->isVisible ($ linkContext = $ collectionContext ->withField ($ field ))) {
7578 continue ;
7679 }
7780
You can’t perform that action at this time.
0 commit comments