Payload CMS Release: 3.11.0

Tag Name: v3.11.0

Release Date: 12/21/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

Payload CMS v3.11.0 introduces SQLite autoIncrement support, fixes critical UI issues with unpublishing documents and join table deletions, ensures client-generated IDs persist correctly, and includes MongoDB optimizations. This release enhances both developer flexibility and user experience with targeted improvements to the admin interface and database adapters.

Highlight of the Release

    • Added autoIncrement option for SQLite adapter to prevent ID reuse
    • Fixed UI issue where unpublish confirmation was unreachable in drawers
    • Fixed join table rows still showing after deletion until page refresh
    • Ensured client-generated IDs persist correctly on create operations
    • Implemented MongoDB optimizations for better performance

Migration Guide

SQLite autoIncrement Option

If you want to enable the new autoIncrement option for SQLite in an existing project, please note that this requires a custom migration as it completely changes how primary keys are stored in the database. This cannot be enabled in an existing project without proper migration planning.

For new projects, you can enable this feature by adding the autoIncrement: true option to your SQLite adapter configuration:

sqliteAdapter({
  autoIncrement: true
})

Upgrade Recommendations

This release is recommended for all users, especially those who:

  1. Use SQLite as their database and need to prevent ID reuse
  2. Have experienced issues with unpublishing documents from within drawers
  3. Have noticed join table rows not updating after deletion
  4. Have encountered problems with client-generated IDs being overwritten
  5. Use MongoDB and want to benefit from the latest optimizations

The upgrade should be straightforward for most users with no breaking changes reported. However, if you plan to enable the new SQLite autoIncrement option in an existing project, you'll need to plan for a custom migration.

Bug Fixes

UI Improvements

Unpublish Confirmation Modal Fix

Fixed an issue where the unpublish confirmation modal was unreachable due to z-index conflicts when opened in drawers. This made it impossible to unpublish documents from within a drawer context, such as when editing a document from a drawer opened in a RelationshipTable. The fix ensures the unpublish modal renders at a sufficiently high z-index while taking drawer depth into account.

Join Table Row Deletion Update

Resolved a problem where deleting an entry in a Join table via the Drawer accessed through DrawerLink would not update the table until the page was refreshed. Now, when a user deletes an item, the UI immediately reflects this change by filtering out the deleted document from the table view, providing a more reactive and intuitive user experience.

Data Handling Fixes

Client-Generated IDs Persistence

Fixed an issue where IDs supplied directly through the API (such as client-side generated IDs when adding new blocks and array rows) were being overwritten on create operations. The system now correctly preserves these IDs when they are supplied, only generating new ones when no ID is provided or when specifically duplicating documents via the beforeDuplicate hook.

MongoDB Optimizations

Addressed several issues introduced in a previous update (#9594) related to MongoDB operations, improving overall database performance and reliability.

New Features

SQLite autoIncrement Option

The SQLite database adapter now supports an autoIncrement option that enables the AUTOINCREMENT feature for primary keys. This prevents the reuse of IDs from previously deleted rows, which can be essential for certain systems.

sqliteAdapter({
  autoIncrement: true
})

This feature is particularly useful when testing whether documents were deleted correctly while also performing other create operations. It leverages Drizzle's built-in autoIncrement option to provide this functionality.

Security Updates

No specific security fixes were included in this release.

Performance Improvements

MongoDB Optimizations

This release includes several optimizations for the MongoDB database adapter that address issues introduced in a previous update. These changes improve the overall performance and reliability of MongoDB operations within Payload CMS.

UI Responsiveness

The fixes to join table row deletion provide a more responsive user interface by immediately updating the table view after deletion, eliminating the need for page refreshes. This creates a smoother, more efficient workflow for content editors working with relationship data.

Impact Summary

Payload CMS v3.11.0 delivers important quality-of-life improvements for both developers and content editors. The addition of SQLite's autoIncrement option gives developers more control over ID management, while the UI fixes for unpublishing documents and join table deletions significantly improve the content editing experience.

The fix for client-generated IDs ensures that operations like adding blocks or array rows maintain their expected behavior, preventing potential data inconsistencies. MongoDB users will benefit from performance optimizations that address issues from previous updates.

Overall, this release focuses on enhancing reliability and user experience without introducing breaking changes, making it a recommended upgrade for all Payload CMS users. The improvements to drawer interactions and immediate UI updates after deletions will be particularly appreciated by content teams working with complex relational data.

Full Release Notes

v3.11.0 (2024-12-21)

🚀 Features

🐛 Bug Fixes

  • ensures generated IDs persist on create (#10089) (957867f)
  • db-mongodb: mongodb optimizations (#10120) (b08ff88)
  • ui: join table row still shows after deletion (#9783) (a58b9fc)
  • ui: ensure unpublish confirmation is reachable when opened in drawers (#10109) (ec853c4)

📚 Documentation

📝 Templates

🤝 Contributors

Statistics:

File Changed121
Line Additions1,717
Line Deletions2,277
Line Changes3,994
Total Commits10

User Affected:

  • Can now enable autoIncrement for SQLite primary keys to prevent ID reuse
  • Benefit from fixes ensuring client-generated IDs persist correctly on create operations
  • Will see MongoDB performance optimizations

Contributors:

denolfer1tsuujacobsfletchzuccsakhrarovsaidAlessioGrdamnsamn