Skip to content

fix(ui): properly render create new button in polymorphic joins #12930

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

Merged
merged 2 commits into from
Jun 27, 2025

Conversation

akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Jun 25, 2025

What?

This PR fixes an issue where the bottom "Create new ..." button would cause a runtime error due to not accounting for a polymorphic join setup.

Why?

To prevent a runtime error and allow users the ability to add new documents to the join as expected even in a polymorphic setup.

How?

Creation of a new AddNewButton which handles all of the add new button instances in the RelationshipTable component.

Addresses #12913 (comment)

Before:

join-polymorphic-runtime-error--Payload.webm

After:

polymorphic-after-Editing---Multiple-Collections-Parent---Payload.1.webm

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@DanRibbens DanRibbens merged commit a1822d2 into payloadcms:main Jun 27, 2025
150 of 152 checks passed
@akhrarovsaid akhrarovsaid deleted the fix/joins-add-new-button branch June 27, 2025 12:10
Copy link
Contributor

🚀 This is included in version v3.44.0

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.

None yet

2 participants