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
In a Statamic multisite setup, attempting to retrieve globals by handle using the REST API with and without specifying the site using the ?site=site_handle query parameter results in a {"message": "Not found."} error. This issue occurs when the global does not belong to the first site in the configuration, making it inaccessible via the API for other sites.
Notably, the issue is resolved immediately if the global is added to the first site in the multisite configuration. Once the global is associated with the first site, it becomes accessible via the API.
How to reproduce
Set up a multisite environment in Statamic with two sites and enable the content rest api.
Create global and configure it to belong to the second site
Attempt to retrieve the global variable via the REST API using the endpoint /api/globals/{handle} returns {"message": "Not found."}
Attempt to retrieve the global variable via the REST API using the endpoint /api/globals/{handle}?site=site_handle returns {"message": "Not found."}
Add the global to the first site in the multisite configuration OR reorder sites so that the second site is the first site
Retry retrieving the global via the API and the global is returned as expected.
I am doing the same thing with nav trees and there it works as expected.
Thanks for looking into this!
Logs
No response
Environment
EnvironmentApplication Name: Statamic DEVLaravel Version: 11.20.0PHP Version: 8.3.9Composer Version: 2.7.7Environment: localDebug Mode: ENABLEDURL: localhost:3000Maintenance Mode: OFFTimezone: UTCLocale: enCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: nullCache: fileDatabase: sqliteLogs: stack / singleMail: smtpQueue: syncSession: fileStatamicAddons: 0Sites: 2 (Site de, , Site en)Stache Watcher: EnabledStatic Caching: DisabledVersion: 5.21.0 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered:
Bug description
In a Statamic multisite setup, attempting to retrieve globals by handle using the REST API with and without specifying the site using the ?site=site_handle query parameter results in a {"message": "Not found."} error. This issue occurs when the global does not belong to the first site in the configuration, making it inaccessible via the API for other sites.
Notably, the issue is resolved immediately if the global is added to the first site in the multisite configuration. Once the global is associated with the first site, it becomes accessible via the API.
How to reproduce
{"message": "Not found."}
{"message": "Not found."}
I am doing the same thing with nav trees and there it works as expected.
Thanks for looking into this!
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: