Home

>

Tools

>

Payload CMS

>

Releases

>

Release 1.2.2

Payload CMS Release: Release 1.2.2

Tag Name: v1.2.2

Release Date: 12/2/2022

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 v1.2.2 brings significant improvements to relationship fields, query operations, and internationalization support. This release focuses on fixing form validation issues, enhancing relationship field functionality, and improving the developer experience with better TypeScript support. The update also includes UI refinements for the code editor and block components, along with important fixes for pagination and query operations.

Highlight of the Release

    • Fixed relationship field issues including population, filtering options, and infinite rerenders
    • Added 'contains' operators for text, email, and radio fields
    • Decoupled pagination from limit parameters, allowing for limitless queries
    • Improved handling of multiple locales in relationship population
    • Enhanced TypeScript support with better type definitions and comments
    • Fixed form validation issues when unpublishing content

Migration Guide

This release doesn't contain breaking changes that require significant migration efforts. However, there are a few things to note:

  1. Relationship Fields: If you were experiencing issues with relationship fields not populating correctly or causing infinite rerenders, this release should fix those issues without requiring code changes.

  2. Query Parameters: The release decouples pagination from limit parameters. If you were relying on specific behavior of the limit parameter in queries, you might want to test your queries to ensure they still work as expected.

  3. TypeScript Types: The release includes improved TypeScript definitions. If you were using custom type overrides for Mongoose models or PaginatedDocs, you might be able to remove those as the built-in types are now more accurate.

No database migrations or configuration changes are required for this update.

Upgrade Recommendations

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

  1. Use relationship fields extensively in their schema
  2. Work with multilingual content
  3. Rely on complex queries with text, email, or radio fields
  4. Need to query data without pagination limits
  5. Have experienced issues with form validation when unpublishing content

The update contains numerous bug fixes and quality-of-life improvements with no breaking changes, making it a safe and beneficial upgrade for all projects. To upgrade, simply run:

npm install [email protected]
# or
yarn add [email protected]

After upgrading, test your application thoroughly, especially if you rely heavily on relationship fields or custom query operations.

Bug Fixes

  • Relationship Fields:

    • Fixed population of form-controlled relationship fields
    • Resolved infinite rerenders in relationship fields
    • Fixed dynamic relationship filterOptions
    • Improved handling of multiple locales in relationship population
    • Enhanced logic for ensuring programmatically set relationship values have options loaded
  • UI/UX Improvements:

    • Fixed blockName component to grow properly in all browsers
    • Improved edit screen sidebar styles
    • Updated syntax colors for light theme in code fields
    • Fixed base class usage in code field
  • Internationalization:

    • Optimized German translations
    • Fixed translation key for "requiresAtLeast" in German locale
    • Fixed translation of select field option labels
    • Fixed translation keys for rich text links
  • Query Operations:

    • Fixed how limit is set in options and pagination
    • Ensured enums cannot query on partial matches
    • Added proper sanitization of number query parameters
    • Fixed indexing of sortable timestamp fields
  • Drafts & Versions:

    • Fixed update of drafts to include latest version changes
    • Fixed validation handling when unpublishing content
    • Added proper validation state checking when restoring content

New Features

  • Limitless Queries: Decoupled limit from pagination, allowing API consumers to make queries without pagination limits
  • Email Error Logging: Added detailed error message logging for email transport issues, making it easier to debug email sending problems
  • Improved TypeScript Support: Enhanced TypeScript comments and definitions throughout the codebase for better developer experience
  • UI Improvements: Removed theme provider and updated background for code fields for a more consistent experience
  • Contains Operators: Added 'contains' operators for text, email, and radio fields, enabling more flexible querying options

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

  • Query Optimization: Improved query handling by decoupling pagination from limit parameters, allowing for more efficient data retrieval
  • Type System Enhancements: Better TypeScript definitions and alignment with Mongoose types reduce type errors and improve development workflow
  • Relationship Field Optimization: Enhanced logic for loading relationship field options, reducing unnecessary re-renders and improving form performance
  • Validation Logic: Improved validation handling when unpublishing content, making the process more efficient

Impact Summary

Payload CMS v1.2.2 is a maintenance release that focuses on fixing bugs and improving existing functionality rather than introducing major new features. The most significant improvements are in relationship fields, query operations, and internationalization support.

For developers, the enhanced TypeScript support and fixed relationship field behavior will improve the development experience and reduce bugs. Content editors will benefit from UI improvements and fixed translation issues. API consumers gain more flexibility with the new contains operators and limitless query options.

The decoupling of pagination from limit parameters is particularly noteworthy as it allows for more flexible data retrieval patterns. The fixes for relationship fields address several pain points that users were experiencing, including infinite rerenders and issues with populating controlled fields.

Overall, this release represents a solid improvement in stability and usability without introducing breaking changes, making it a recommended upgrade for all Payload CMS users.

Full Release Notes

1.2.2 (2022-12-02)

Bug Fixes

  • adds contain operators for text/email/radio fields (4c37af6)
  • adjusts how limit is set, both in options and paginates limit (a718010)
  • aligns mongoose PaginatedDocs type with actual lib type (dce2081)
  • allows for form controlled relationship fields to be populated (e4435bb)
  • allows for limit bypass on version find operations (891f00d)
  • blockName grows in all browsers (03c2ab5)
  • corrects skipValidation (e6f1c6f)
  • dynamic relationship filterOptions (99c1f41)
  • ensures enums cannot query on partial matches (ec51929)
  • german translation optimizations (#1485) (e9d2163)
  • handle multiple locales in relationship population (#1452) (04c689c)
  • i18n: requiresAtLeast variable in de.json (#1556) (47fd0d9)
  • ignore validation when unpublishing, do not allow restore with invalid form state (77ab542)
  • indexSortableFields timestamp fields #1506 (#1537) (7aada3c)
  • infinite rerenders, accounts for hasMany false (16d00e8)
  • moves relationship field useEffect into async reducer action (54ef40a)
  • moves sharp types from devDeps to deps (b3d526b)
  • reverts async reducer and resolves infinite effect (a9da81f)
  • sanitize number query params before passing to find operation (c8d1b9f)
  • translate select field option labels (#1476) (3a9dc9e)
  • update drafts includes latest version changes (48989d0)
  • updates code field css (3eebd66)
  • updates syntax colors for light theme (dbfe7ca)
  • uses baseClass in code field (d03f0ae)

Features

  • decouples limit from pagination, allows for no limit query (f7ce0c6)
  • improve typescript comments (#1467) (5bd8657)
  • log email transport error messages (#1469) (a90a1a9)
  • removes theme provider and updates background for code fields (1a6c9a3)

Statistics:

File Changed117
Line Additions2,229
Line Deletions1,083
Line Changes3,312
Total Commits71

User Affected:

  • Improved TypeScript support with better type definitions and comments
  • Enhanced relationship field functionality with better population and filtering options
  • Fixed issues with form validation when unpublishing content
  • Better error logging for email transport issues

Contributors:

JarrodMFleschDanRibbens383bd03djmikrutjacobsfletchchristian-reichartjessrynkariheidari-acidenolfethghangelobartolomeChrisWaschljnicewander