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

examples: multi-tenant add all params to tenantsArrayField #10975

Closed

Conversation

bratvanov
Copy link
Contributor

What?

After updating to Payload v3.20.0, my app derived from the multi-tenant example started throwing an error:

InvalidFieldRelationship: Field Tenant has invalid relationship 'undefined'.

A quick search revealed a comment by @janbiasi which pointed out the issue – a missing tenantsCollectionSlug in tenantsArrayField defined in the Users collection.

Fixes #10874

CC @JarrodMFlesch

@bratvanov
Copy link
Contributor Author

This commit which landed in Payload v3.21.0 changed the params of the tenantsArrayField, once again making the multi-tenant example outdated and throwing an error:

TypeError: Cannot read properties of undefined (reading 'includes')

I've pushed another commit to this PR which adds the new params to the multi-tenant example.

CC @JarrodMFlesch 🙏

@bratvanov bratvanov changed the title examples: multi-tenant add tenantsCollectionSlug in Users collection examples: multi-tenant add all params to tenantsArrayField Feb 6, 2025
@JarrodMFlesch
Copy link
Contributor

@bratvanov thank you for this! I really do not want this issue to fall onto the example though. The plugin should be using default values for these arguments. I opened this PR that does just that. Let me know what you think. Should we keep your PR? I don't want to overwhelm users with arguments if they don't need them.

JarrodMFlesch added a commit that referenced this pull request Feb 6, 2025
…ts (#11030)

Creates a default variables file to use in exported components.
Extension of #10975.
@bratvanov
Copy link
Contributor Author

@JarrodMFlesch I completely agree, your approach with default values in the plugin is more elegant, thank you for implementing it! I'll close this PR in favor of #11030.

@bratvanov bratvanov closed this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tenant Invalid Relationship when installing multi-tenant example
2 participants