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

Multi-site: Selected site in Vuex store is undefined #2237

Closed
aerni opened this issue Aug 16, 2020 · 0 comments
Closed

Multi-site: Selected site in Vuex store is undefined #2237

aerni opened this issue Aug 16, 2020 · 0 comments

Comments

@aerni
Copy link
Contributor

aerni commented Aug 16, 2020

Bug Description

When creating/editing an entry, I need to know the currently active site to compute a value in a custom fieldtype.

I found the selected site's handle to be stored in this.$store.state.publish.base.site. The value, however, is only set when editing an existing entry. It is undefined when creating a new entry.

Maybe there's another way to get the currently selected site, that I didn't figure out yet?

How to Reproduce

  1. Create a new entry and check Vuex store at state.publish.base.site. The value will be undefined.
  2. Save the entry and check the value again. It will be the currently selected site.

Extra Detail

Creating a new entry:

Bildschirmfoto 2020-08-16 um 14 28 04

Editing an existing entry:

Bildschirmfoto 2020-08-16 um 14 28 36

Environment

Statamic version: 3.0.0-beta.43

PHP version: 7.4.6

Install method: Fresh install from statamic/statamic

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

No branches or pull requests

2 participants