cms
cms copied to clipboard
Empty publish form on multi-site when CP is set to different site
Bug description
When trying to create an Entry and the CP is set to a site that the collection is not available in you get an empty publish form. The browser console shows an error (see below).
It shows http://multi-site-bug.test/cp/collections/pages/entries/create/english in the URL bar but the collection is not configured for the english
site. Changing english
to german
in the URL shows the proper Publish Form. When you set the CP to a different site it also works as expected.


How to reproduce
- Have a multi site setup
- Log in to the CP
- Set the CP to
site1
(from top nav) - Configure a collection to be only available in
site2
- Create a new entry (while the CP is still set to
site1
) - You get presented with an empty Publish Form
- When you switch the whole CP to
site2
and reload the page you get the the proper Publish Form
Logs
[Error] TypeError: undefined is not an object (evaluating '_.findWhere(this.localizations,{active:!0}).livePreviewUrl') — PublishForm.vue:377
qe (vendor.js:2:1184655)
$e (vendor.js:2:1184568)
Re (vendor.js:2:1184218)
(anonymous function) (vendor.js:2:1207632)
r (vendor.js:2:1240960)
(anonymous function) (vendor.js:2:1199575)
fn (vendor.js:2:1199492)
(anonymous function) (vendor.js:2:1240973)
init (vendor.js:2:1192344)
(anonymous function) (vendor.js:2:1229279)
d (vendor.js:2:1229554)
p (vendor.js:2:1230143)
d (vendor.js:2:1229669)
(anonymous function) (vendor.js:2:1233686)
(anonymous function) (vendor.js:2:1206647)
r (vendor.js:2:1240950)
(anonymous function) (vendor.js:2:1199575)
fn (vendor.js:2:1199492)
(anonymous function) (vendor.js:2:1240973)
init (vendor.js:2:1192344)
(anonymous function) (vendor.js:2:1229279)
d (vendor.js:2:1229554)
(anonymous function) (vendor.js:2:1233686)
(anonymous function) (vendor.js:2:1206647)
r (vendor.js:2:1240950)
(anonymous function) (vendor.js:2:1199575)
fn (vendor.js:2:1199492)
(anonymous function) (vendor.js:2:1240973)
init (vendor.js:2:1192344)
(anonymous function) (vendor.js:2:1229279)
d (vendor.js:2:1229554)
p (vendor.js:2:1230143)
d (vendor.js:2:1229669)
p (vendor.js:2:1230143)
d (vendor.js:2:1229669)
p (vendor.js:2:1230143)
d (vendor.js:2:1229669)
p (vendor.js:2:1230143)
d (vendor.js:2:1229669)
(anonymous function) (vendor.js:2:1233954)
(anonymous function) (vendor.js:2:1206647)
r (vendor.js:2:1240950)
(anonymous function) (vendor.js:2:1199575)
fn (vendor.js:2:1199492)
(anonymous function) (vendor.js:2:1240973)
(anonymous function) (vendor.js:2:1205158)
kn (vendor.js:2:1202037)
start (app.js:2:340656)
start
Global Code (english:394)
Environment
Environment
Application Name: Statamic
Laravel Version: 9.31.0
PHP Version: 8.1.10
Composer Version: 2.4.2
Environment: local
Debug Mode: ENABLED
URL: multi-site-bug.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Statamic
Addons: 0
Antlers: runtime
Version: 3.3.37 PRO
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
runtime (new)
Additional details
No response