Hey,
@281120856527077378. I was wondering if it's possible in the current plugin to not automatically select the first tenant if I create a new item in a collection. This is something I have in my current implementation of multi tenant but I'd like to transition to using the plugin.
For example, I have a Pages collection and I initially do not have a tenant selected and I click "Create New" in the Pages collection, what happens right now is it automatically selects the first tenant. I've checked the documentation and it seems like in order for me to do this, I need to not include the Pages collection in the config of multiTenantPlugin just like the Users and instead have it's own read access. I can do that of course but before doing so, I'd just like to know if this is something already built in and I just miss it.
Thanks a lot for your work!
Hmmm interesting request. I mean you can still change the tenant with the selector in the top left before actually creating the document.
I also have this problem. The selector switches back to the first tenant in the list when I create a new page of post. As a result the page is created for the first tenant. When I switch back to the previously selected tenant, the page is reassigned to the correct tenant.
This only happens when you don't already have a tenant selected correct? If so, try updating all packages to the latest version of payload (3.20.0)
I updated to 3.20 and still the tenant selecter switches back to the first tenant. See attached video.
So it seems the selector isn't persisted, is this a cookie related issue? I tested it with a knowledge base collection and this one doesn't refresh the whole page like the pages collection. But when I save the article it switches to the first tenant. See video:
Also, when I add the Selector on collection level in the sidebar, the selected tenant stays persisted but as a super-admin this isn't a great experience.
interesting! I have not seen any of that before. I wonder what is happening 🤔
It is based on a cookie. you can inspect the application tab in the inspector and find it under
payload-tenantAny way you could give me a smaller reproduction? i.e. a smaller set of fields. Would love to know what is causing it so I can fix it
Oke, the cookie is switching from 2 to 1.
does that collection have autosave on it
wonder if thats it
So the, selector also switches back to tenant 1 but doesn't save it under tenant 1 automatically.
I do see some differences with the tenant selector in the nav sidebar and the collection level selector. If I activate the collection level selector I get a (i think) edit icon next to it and stays persisted on that tenant. Will see if i can get a video of it after it. For now this is the video of the media collection.
I activated the tenant selector on collection level. This fixes it as a workaround but the selector in the nav sidebar should do the same and remember the chosen tenant always.
That's true, but I wanted to create a new outside a tenant. If I understand it correctly, if a tenant is selected and an item is created, the item automatically becomes part of the selected tenant (if no tenant field is added in the collection).
And once I am in the "Create New" page, the ability to remove the tenant (x icon) disappears so there is no way for me to save a new item without a tenant.
Yeah but the tenant field saved on the page document is set to required. I feel like it might cause more confusion if it was not required.
Couldn’t you add a tenant that you use to create pages on that no users are assigned to and use that as the tenant you select when creating new “unassigned” documents
Any update yet? Is this something that can be fixed in an upcoming release?
If someone can throw together a minimal reproduction inside a blank template I can take a look
Can you all install the latest version released today and report back. Should be better now
Hi Jarrod, upon testing, first tenant is still automatically selected. Is that supposed to be fixed?
yeah, in next release 😭
I fixed it right as the release went out, didnt make it in unfortunately
new release is out now, fix is in there!
3.22.0
Thanks Jarrod!, problem is fixed and works in v3.22.0!

Quick follow up, unrelated
@281120856527077378. Since the update, the first grouped nav items starts closed, then when opened and navigating to another page, the group closes again. Is this something I can easily fix? Is it related to the update or just my bad coding skills.. 😅
Try resetting your preferences by navigating to /account and hitting the button at the bottom
Thanks, that did the trick!
Worked for me. Thanks
@281120856527077378🙏
Star
Discord
online
Get dedicated engineering support directly from the Payload team.