Home

>

Tools

>

Payload CMS

>

Releases

>

3.0.0-beta.120

Payload CMS Release: 3.0.0-beta.120

Pre Release

Tag Name: v3.0.0-beta.120

Release Date: 10/29/2024

Payload CMS LogoPayload CMS

Payload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.

TL;DR

PayloadCMS v3.0.0-beta.120 brings important improvements to the developer experience with new join field options, fixes for document locking, cursor preservation in rich text editors, and several critical bug fixes. This release enhances database compatibility, improves UI interactions, and resolves issues with autosave functionality.

Highlight of the Release

    • Added defaultSort and defaultLimit options for join fields
    • Fixed cursor/selection preservation in rich text editor when working with drawers
    • Improved document locking system to properly handle expired locks
    • Fixed autosave race conditions that could cause loss of 'latest: true' flag
    • Resolved MongoDB query issues with 'in' operator and comma-delimited values

Migration Guide

No breaking changes were introduced in this release that would require migration. However, if you're using database adapters with the beta version, ensure you're using the @beta tag when installing them as mentioned in the documentation updates.

Upgrade Recommendations

This release is recommended for all users of PayloadCMS v3.0.0-beta, especially those who:

  1. Use the rich text editor with drawers (links, uploads, relationships)
  2. Rely on document locking functionality
  3. Use MongoDB with join fields and 'in' queries
  4. Experience issues with autosave functionality
  5. Use Vercel Postgres with create-payload-app

The upgrade should be straightforward with no breaking changes. Update your package.json to reference v3.0.0-beta.120 and run your package manager's install command.

Bug Fixes

Rich Text Editor Improvements

  • Fixed an issue where the cursor/selection state in the Lexical rich text editor would reset to the beginning when interacting with drawers (like links, uploads, relationships). The editor now properly preserves and restores selection state when working with all types of drawers.

Document Locking Fixes

  • Fixed document locking behavior to only show locks that are not expired in the list view
  • Prevented the "Document Locked" modal from appearing for expired locks
  • Added automatic cleanup of expired locks when any user edits a document in the same collection
  • Extended the lock expiration fix to global documents as well

Database and Query Fixes

  • Fixed MongoDB in query operator when used with comma-delimited values in collections with join fields
  • Fixed Vercel Postgres setup in create-payload-app to properly write POSTGRES_URL to the .env file

Form Builder and Autosave Fixes

  • Fixed payment static value field in the form builder
  • Resolved a race condition in autosave that could cause versions to lose the latest: true flag and potentially introduce conflicts with the parent field

New Features

Join Field Enhancements

Added the ability to specify defaultSort and defaultLimit options for join fields. This eliminates the need to always use query parameters when populating join fields, making it much easier to set default behavior. Previously, developers had to use query patterns like ?joins[categories][limit]=0 for every request, but now these defaults can be set directly in the field configuration.

Security Updates

No specific security fixes were included in this release.

Performance Improvements

Database Query Optimization

The fix for MongoDB's in query operator with comma-delimited values improves query performance by ensuring proper type casting. This prevents potential performance issues that could occur when MongoDB fails to properly handle these queries.

Document Lock Management

Improved the document locking system to automatically clean up expired locks, reducing database clutter and ensuring the system only tracks and displays active locks. This optimization helps maintain a cleaner database state and improves UI responsiveness.

Impact Summary

PayloadCMS v3.0.0-beta.120 delivers significant quality-of-life improvements for both developers and content editors. The addition of defaultSort and defaultLimit options for join fields simplifies development by reducing the need for query parameters. Content editors will benefit from a more reliable editing experience with fixed cursor preservation in the rich text editor and improved document locking behavior.

The release also addresses several critical bugs, including autosave race conditions and MongoDB query issues, which enhances overall system stability. Documentation improvements ensure developers can correctly install database adapters with the beta version.

While this is a beta release, the improvements are substantial and address real-world usage issues reported by the community. The changes are focused on enhancing usability and fixing bugs rather than introducing breaking changes, making this a recommended upgrade for all users of the beta version.

Full Release Notes

v3.0.0-beta.120 (2024-10-29)

🚀 Features

🐛 Bug Fixes

  • autosave potentially losing latest: true w/ race condition (#8894) (00ed66b)
  • form-builder payment static value field (#8905) (44e52b0)
  • cpa: write POSTGRES_URL to .env for vercel postgres (#8743) (aea1b41)
  • db-mongodb: query 'in' with a comma-delimited value (#8910) (7a7a2f3)
  • next, ui: exclude expired locks for globals (#8914) (e74906f)
  • next, ui: only show locked docs that are not expired (#8899) (1e002ac)
  • richtext-lexical: ensure editor cursor / selection state is preserved when working with drawers (#8872) (a8569b9)

🤝 Contributors

Statistics:

File Changed92
Line Additions1,234
Line Deletions222
Line Changes1,456
Total Commits12

User Affected:

  • Can now set defaultSort and defaultLimit on join fields without having to use query parameters
  • Benefit from fixed MongoDB 'in' query operator when using comma-delimited values
  • Will see proper environment variable setup for Vercel Postgres in create-payload-app
  • Can follow updated documentation for database adapter installation with correct beta version tags

Contributors:

denolfeAlessioGrr1tsuujmikrutBrandokoakhrarovsaidDanRibbensPatrikKozak