Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating new entries via collection widgets does not honor selected site #9678

Closed
fjahn opened this issue Mar 7, 2024 · 0 comments · Fixed by #9699
Closed

Creating new entries via collection widgets does not honor selected site #9678

fjahn opened this issue Mar 7, 2024 · 0 comments · Fixed by #9699

Comments

@fjahn
Copy link
Contributor

fjahn commented Mar 7, 2024

Bug description

On multisites, creating new entries via the collection index page creates the new entry as whatever site is selected in the CP's navbar.

If you use the Create Entry button on a collection widget on the dashboard, the entry is created on the same site always, regardles of which site is selected in the navbar. (On my page of two sites, this is the one that is defined second in sites.php.)

How to reproduce

  • Add a second site to config/statamic/sites.php, e.g.
'sites' => [
    'english' => [
        'name' => 'English',
        'locale' => 'en_US',
        'url' => '/',
    ],
    'german' => [
        'name' => 'Deutsch',
        'locale' => 'de_AT',
        'url' => '/de/',
    ],
],
  • Add a collection posts which is available in both sites.
  • Select english site in the navbar.
  • Use the Create Entry button on posts's collection index page.
  • The entry is created on the english site.
  • Select german site in the navbar.
  • As expected, the entry is created on the german site.
  • Add a collection widget for posts entries to the dashboard inconfig/statamic/cp.php:
'widgets' => [
    [
        'type' => 'collection',
        'collection' => 'posts',
    ],
],
  • With the german site still selected in the navbar, use the Create Entry button in the new collection widget.
  • The entry is created on the german site.
  • Select english site in the navbar and click the Create Entry button in the collection widget again.
  • The entry is still created on the german site, even though english is selected.

Logs

No response

Environment

Environment
Application Name: xxx
Laravel Version: 10.47.0
PHP Version: 8.2.16
Composer Version: -
Environment: local
Debug Mode: ENABLED
URL: localhost:8000
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: daily
Mail: smtp
Queue: database
Session: file

Statamic
Addons: 1
Antlers: runtime
Sites: 2 (English, Deutsch)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.52.0 PRO

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

Runtime (default)

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants