Home

>

Tools

>

Payload CMS

>

Releases

>

Release 1.6.30

Payload CMS Release: Release 1.6.30

Tag Name: v1.6.30

Release Date: 4/3/2023

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.6.30 fixes two important bugs: one preventing mutation of the original document in beforeChange field hooks and another correcting type definitions for the local API when using delete with where conditions. These fixes improve data integrity and TypeScript type safety for developers using Payload.

Highlight of the Release

    • Fixed issue with originalDoc being mutated in beforeChange field hooks
    • Corrected TypeScript type definitions for local API's delete operation with where conditions

Migration Guide

No migration is required for this release. The fixes are backward compatible and should not break existing functionality.

Upgrade Recommendations

This release contains important bug fixes that improve data integrity and type safety. It is recommended for all users to upgrade to v1.6.30, especially if you:

  1. Use beforeChange field hooks in your Payload configuration
  2. Use the local API's delete operation with where conditions in TypeScript projects

The upgrade should be straightforward with no breaking changes.

Bug Fixes

Fixed mutation of originalDoc in beforeChange field hooks

This release fixes an issue where the originalDoc was being unintentionally mutated in beforeChange field hooks. This could lead to unexpected behavior when multiple hooks were relying on the original document state. The fix ensures that the original document remains immutable throughout the hook execution chain, maintaining data integrity during document updates.

Corrected TypeScript type definitions for local API delete operations

Fixed incorrect TypeScript type definitions when using the local API's delete operation with where conditions. This improves type safety and developer experience when working with TypeScript in Payload projects.

New Features

No new features were added in this release.

Security Updates

No security fixes were included in this release.

Performance Improvements

No specific performance improvements were included in this release.

Impact Summary

This maintenance release addresses two specific bugs that could affect developers working with Payload CMS:

  1. The fix for originalDoc mutation in beforeChange field hooks ensures that hooks can reliably access the original document state without unexpected changes, improving the predictability and reliability of hook behavior.

  2. The correction to TypeScript type definitions for the local API's delete operation with where conditions improves the developer experience when using TypeScript, providing better type safety and reducing potential runtime errors.

While these changes are relatively minor in scope, they address important edge cases that could lead to subtle bugs in applications built with Payload CMS.

Full Release Notes

1.6.30 (2023-04-03)

Bug Fixes

  • incorrect type local api using delete with where (de5ceb2)
  • originalDoc being mutated in beforeChange field hooks (888bbf2)

Statistics:

File Changed5
Line Additions26
Line Deletions4
Line Changes30
Total Commits5

User Affected:

  • Fixed issue with `originalDoc` being mutated in `beforeChange` field hooks, ensuring data integrity during document updates
  • Corrected TypeScript type definitions for local API when using `delete` with `where` conditions, improving type safety

Contributors:

DanRibbensjmikrut