You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Link fieldtype recursively augments linked entries causing infinite loop #14696
A link fieldtype that points to an entry whose own link field points back triggers infinite recursion as soon as anything deep-augments the entry (live preview,Entry::toArray(), JSON serialization etc.).
Expected:
The augmentation should bottom out, like it does for the other relationship fieldtypes (entries, terms, users).
How to reproduce
Create a blueprint with a link field.
Add two entries A and B; A's link_field = entry::B, B's link_field = entry::A.
Any template that JSON-serializes the entry, e.g. {{ page | to_json }}.
Visit A in the browser:
Maximum call stack size … reached. Infinite recursion?
Logs
Environment
EnvironmentApplication Name: StatamicLaravel Version: 12.60.1PHP Version: 8.4.19Composer Version: 2.9.8Environment: localDebug Mode: ENABLEDMaintenance Mode: OFFTimezone: UTCLocale: enCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: logCache: fileDatabase: mysqlLogs: stack / singleMail: smtpQueue: syncSession: fileStoragepublic/storage: NOT LINKEDStatamicSites: 8 (English, Deutsch, Español, and 5 more)Stache Watcher: DisabledStatic Caching: DisabledVersion: 5.73.22 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
It is also a V6 issue.
Possible "fix"
In src/Fieldtypes/Link/ArrayableLink.php:
public function toArray()
{
- return is_object($this->value)- ? $this->value->toAugmentedArray()- : ['url' => $this->url()];+ if (! is_object($this->value)) {+ return ['url' => $this->url()];+ }++ if ($this->value instanceof \Statamic\Contracts\Data\Augmentable) {+ return array_merge(+ $this->value->toShallowAugmentedArray(),+ ['url' => $this->url()]+ );+ }++ return ['url' => $this->url()];
}
Activity
o1y commentedon May 20, 2026
Could be a duplicate of #9105
duncanmcclean commentedon May 21, 2026
Sounds like the same issue to me. Closing in favour of #9105