Skip to content

Conversation

@akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Jun 24, 2025

What?

This PR fixes a runtime error that occurs when opening the "More versions..." drawer while browsing the versions for a global. It also fixes a minor runtime error when navigating to a global version view where an optional chaining operator was missing as the collection variable would be undefined as we are viewing a global.

This PR also adds an e2e test to ensure the versions drawer is accessible and renders the appropriate number of versions for globals.

Why?

To properly render global version views without errors.

How?

By threading the global slug to the versions drawer and adjusting some properties of the renderDocument server function call there. This PR also adds an optional chaining operator the versionUseAsTitle in the original view to prevent an error in globals.

Notes:

  • This was brought to my attention in Discord by a handful of users

Before: (Missing optional chaining error)

error1-verions-Editing---Menu---Payload.webm

Before: (Versions drawer error)

error2-versions-Editing---Menu---Payload.webm

After:

versions-globals-Dashboard---Payload.webm

@jacobsfletch jacobsfletch merged commit 39e9519 into payloadcms:main Jun 24, 2025
84 checks passed
@akhrarovsaid akhrarovsaid deleted the fix/global-versions-drawer branch June 24, 2025 17:19
@github-actions
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.

2 participants