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

defaultValue is ignored when creating a doc from "Add new" on a join field. #8612

Open
energee opened this issue Oct 8, 2024 · 3 comments
Open
Assignees
Labels

Comments

@energee
Copy link

energee commented Oct 8, 2024

Link to reproduction

No response

Environment Info

Node: 22.9.0
npm: 10.8.3
Yarn: 1.22.22
pnpm: 9.10.0
Relevant Packages:
payload: 3.0.0-beta.111
next: 15.0.0-canary.173
@payloadcms/db-mongodb: 3.0.0-beta.111
@payloadcms/graphql: 3.0.0-beta.111
@payloadcms/next/utilities: 3.0.0-beta.111
@payloadcms/richtext-lexical: 3.0.0-beta.111
@payloadcms/translations: 3.0.0-beta.111
@payloadcms/ui/shared: 3.0.0-beta.111
react: 19.0.0-rc-3edc000d-20240926
react-dom: 19.0.0-rc-3edc000d-20240926

Describe the Bug

defaultValue setting appears to not work when generating a new doc from a join field.

Reproduction Steps

Set a defaultValue on a collection -> Test by creating a new item -> Try creating a new item from a join field ("Add New" or "Create New " button), field will be blank.

Adapters and Plugins

db-mongodb

@energee energee added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 8, 2024
@akhrarovsaid
Copy link
Contributor

akhrarovsaid commented Oct 11, 2024

Hey @energee,

I believe this is happening because these lines are preventing this function from being called due to the predicate above it. I plan to have a PR out soon, hopefully by tonight. Seems I'm close to a fix.

@akhrarovsaid
Copy link
Contributor

Hey @energee,

Thanks for your patience - I have a PR up for this.

@akhrarovsaid
Copy link
Contributor

akhrarovsaid commented Nov 15, 2024

Hey @energee,

I've closed my PR as I'm no longer able to reproduce this issue in the monorepo as of beta.128. Try updating your Payload packages and test if you're still experiencing default values not populating?

Edit: See here
https://github.com/user-attachments/assets/a5b4b75d-757d-4c51-a385-acc094c89add

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

Successfully merging a pull request may close this issue.

4 participants