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

fix(plugin-search): prevent error on undefined value in linkToDoc component #9932

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Dec 12, 2024

What?

This PR fixes a runtime error encountered when navigating into a search doc that had its' related collection doc deleted, but it itself remained (if for example deleteFromSearch deletion failed for some reason).

Why?

To prevent runtime errors for end-users using plugin-search.

How?

By returning earlier if the field value is undefined or missing required values in LinkToDoc.

Related #9443 (see also: #9623)

@akhrarovsaid akhrarovsaid changed the title fix(plugin-search): prevent error on undefined value in useField fix(plugin-search): prevent error on undefined value in linkToDoc component Dec 12, 2024
@paulpopus paulpopus enabled auto-merge (squash) December 13, 2024 15:27
@paulpopus paulpopus merged commit 29ad1fc into payloadcms:main Dec 17, 2024
63 checks passed
Copy link
Contributor

🚀 This is included in version v3.9.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.

2 participants