2.25.0 (2024-07-26)
Features
- allows metadata to be appended to the file of the output media (#7295) (3c5cce4)
- db-mongodb: adds new optional
collationfeature flag behind mongodb collation option (#7359) (9750bc2), closes #7349
Tag Name: v2.25.0
Release Date: 7/26/2024
Payload CMSPayload 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.
This release introduces two notable features: the ability to append metadata to uploaded media files and MongoDB collation support. It also addresses several bugs, including fixes for handling null values in query strings, preserving ObjectIDs in deep copies, properly displaying zero values in list views, and improving relationship filtering. These changes enhance both the developer experience and system reliability.
To use the new media metadata feature, update your upload field configuration to include the withMetadata option:
{
name: 'media',
type: 'upload',
relationTo: 'media',
withMetadata: true // Enable metadata to be appended to the file
}
To enable MongoDB collation features, update your MongoDB adapter configuration:
import { mongooseAdapter } from '@payloadcms/db-mongodb'
const mongoDBAdapter = mongooseAdapter({
// Your existing MongoDB config
collation: true // Enable MongoDB collation
})
Note that enabling collation may change the behavior of text comparisons and sorting in your application, so test thoroughly after enabling this feature.
This release contains valuable features and important bug fixes without introducing breaking changes. It's recommended for all PayloadCMS users to upgrade to version 2.25.0, especially if you:
The upgrade should be straightforward as this is a non-breaking release. Simply update your PayloadCMS dependency to version 2.25.0 in your package.json and run your package manager's install command.
Previously, number fields with a value of 0 were not being properly displayed in list views (issue #5510). This has been fixed, ensuring that zero values are correctly rendered.
The equality check for relationship options in filters has been relaxed to address an issue where string values from query parameters weren't matching numeric IDs. This was particularly problematic with PostgreSQL, where IDs are numbers by default, causing infinite loops in some cases (issue #7103).
The system now properly handles null values in query strings, fixing an issue where null values weren't being correctly processed between client and server.
The deepCopyObject function was previously converting MongoDB ObjectIDs to a different format, which caused issues when these IDs needed to be preserved. This has been fixed to ensure ObjectIDs pass through the deep copy process unchanged.
PayloadCMS now allows metadata to be appended to uploaded media files through the new withMetadata configuration option in the uploads config. This feature enables developers to store additional information directly within the media files themselves, which can be useful for embedding copyright information, descriptions, or other metadata that should travel with the file.
A new optional collation feature flag has been added to the MongoDB adapter configuration. This enables MongoDB's collation capabilities, which provide language-specific rules for string comparison. This is particularly valuable for applications that need to handle international text with proper sorting and searching capabilities.
No specific security fixes were included in this release.
The relaxed equality check for relationship options in filters not only fixes a bug but also prevents potential infinite loops that could occur with PostgreSQL databases, improving overall system performance and stability.
The fix for preserving ObjectIDs in the deepCopyObject function improves the efficiency of operations that need to maintain MongoDB's native ObjectID format, reducing unnecessary conversions.
PayloadCMS 2.25.0 enhances the platform's capabilities with two notable features: media metadata support and MongoDB collation. The media metadata feature allows developers to embed additional information directly into media files, which is valuable for maintaining file-level metadata that persists outside the database. The MongoDB collation support improves text handling for international applications.
Several important bug fixes are included that address pain points reported by users. The fix for zero values in list views resolves a long-standing display issue. The relationship filtering improvement is particularly important for PostgreSQL users who may have experienced infinite loops. Support for null values in query strings and proper preservation of ObjectIDs make the system more robust overall.
These changes collectively improve both developer experience and end-user reliability without introducing breaking changes, making this a recommended upgrade for all PayloadCMS users.