TL;DR
Payload CMS v1.14.0 brings significant improvements to the admin experience with new features like text alignment in the rich text editor, keyboard shortcuts, and enhanced accessibility. This release also introduces developer-focused improvements including async relationship filter options, afterOperation hooks, and making the PAYLOAD_CONFIG_PATH optional. Security has been tightened by restricting redirects to admin sub-routes only, and several bug fixes improve the overall stability of the platform.
Highlight of the Release
- Text alignment options added to the rich text editor
- Keyboard shortcuts support for improved productivity
- Enhanced accessibility across the admin dashboard
- New afterOperation hook for custom logic after operations
- Async relationship filter options
- PAYLOAD_CONFIG_PATH is now optional with automatic config detection
- Security improvement preventing redirects to external sites
Migration Guide
No breaking changes have been introduced in this release, so migration should be straightforward. Simply update your Payload CMS version to 1.14.0.
If you were relying on the specific behavior of the WhereBuilder component or had custom implementations around it, you might want to test your queries after upgrading as the query handling has been improved.
For developers who want to take advantage of the new features:
-
Text Alignment: The rich text editor now supports text alignment. No configuration is needed to use this feature.
-
afterOperation Hook: You can now implement the afterOperation hook in your collections:
export const MyCollection: CollectionConfig = {
slug: 'my-collection',
hooks: {
afterOperation: [
async ({ args, operation, result }) => {
// Your custom logic here
console.log(`Operation ${operation} completed with result:`, result);
}
]
},
// ...other configuration
}
-
Async Relationship Filter Options: You can now use async functions for relationship filter options:
{
name: 'relatedDocs',
type: 'relationship',
relationTo: 'docs',
filterOptions: async ({ data, user }) => {
// Async logic to determine filter options
return {
someField: {
equals: await someAsyncOperation()
}
}
}
}
-
PAYLOAD_CONFIG_PATH: This environment variable is now optional. Payload will search for your config file in common locations if not specified.
Upgrade Recommendations
We recommend all users upgrade to Payload CMS v1.14.0 as it includes important security fixes, accessibility improvements, and valuable new features that enhance both the developer and content editor experience.
The upgrade process should be straightforward with no breaking changes:
npm install [email protected]
# or
yarn add [email protected]
# or
pnpm add [email protected]
After upgrading, test your application thoroughly, especially if you have custom implementations around the WhereBuilder component or complex relationship filters.
Developers are encouraged to explore the new features like text alignment in the rich text editor, keyboard shortcuts, and the afterOperation hook to enhance their applications.
Bug Fixes
Date Picker Fix
Fixed an issue where the DatePicker was only showing the selected day by default, limiting visibility of other dates.
External Redirects Security Fix
Fixed a security vulnerability by restricting redirects to only allow /admin sub-routes, preventing potential open redirect attacks to external websites.
Image Resize Height Option
Fixed an issue where the height parameter was not being passed to the resizeOptions upload option, preventing proper image height resizing.
WhereBuilder Query Handling
Improved the WhereBuilder component to accept all valid Where queries, fixing issues with query transformation and validation that were causing problems with filtering data.
New Features
Text Alignment in Rich Text Editor
The rich text editor now supports text alignment options, allowing content editors to align text left, center, right, or justify. This feature has been implemented with careful consideration for list elements and void elements.
Keyboard Shortcuts
A new hotkeys system has been implemented across the admin panel, enabling users to perform common actions using keyboard shortcuts. This significantly improves productivity for power users.
afterOperation Hook
Developers can now use the new afterOperation hook to execute custom logic after operations like find, create, update, and delete. This provides greater flexibility for implementing side effects or additional processing after database operations.
Async Relationship Filter Options
Relationship fields now support asynchronous filter options, allowing developers to dynamically load relationship options based on conditions or external data sources.
Optional PAYLOAD_CONFIG_PATH
The PAYLOAD_CONFIG_PATH environment variable is now optional. Payload will automatically search for configuration files in common locations if the path is not explicitly specified.
Improved Admin Dashboard Accessibility
Significant accessibility improvements have been made throughout the admin dashboard, making the CMS more usable for people with disabilities and improving compliance with accessibility standards.
Azerbaijani Language Support
Added Azerbaijani language localization file for international users.
Improved Field Operations
Enhanced field operations for better developer experience and more efficient data handling.
Security Updates
Restricted Redirects
Fixed a security vulnerability by restricting redirects to only allow /admin sub-routes, preventing potential open redirect attacks to external websites. This change ensures that users cannot be redirected to malicious external sites through the admin interface.
Performance Improvements
Admin Panel File Caching
Improved caching of files in the admin panel, resulting in faster load times and better overall performance.
Field Operations Optimization
The field operations have been optimized for better performance, particularly when dealing with complex data structures and relationships.
Impact Summary
Payload CMS v1.14.0 delivers a well-rounded update that improves the platform across multiple dimensions. Content editors will appreciate the enhanced rich text editor with text alignment options and keyboard shortcuts that streamline their workflow. Developers gain powerful new tools like the afterOperation hook and async relationship filters that enable more complex and dynamic implementations.
The accessibility improvements make the admin dashboard more inclusive and compliant with standards, benefiting users with disabilities and organizations with accessibility requirements. Security enhancements, particularly the restriction of redirects to admin sub-routes, protect against potential vulnerabilities.
The optional PAYLOAD_CONFIG_PATH feature simplifies setup and configuration, especially in containerized environments or when using standard project structures. International users benefit from expanded language support with the addition of Azerbaijani.
Overall, this release enhances Payload CMS's position as a developer-friendly, secure, and user-focused headless CMS by addressing needs across the spectrum of its user base while maintaining backward compatibility.
Full Release Notes
1.14.0 (2023-08-16)
Bug Fixes
- DatePicker showing only selected day by default (#3169) (edcb393)
- only allow redirects to /admin sub-routes (c0f05a1)
- passes in height to resizeOptions upload option to allow height resize (#3171) (7963d04)
- WhereBuilder component does not accept all valid Where queries (#3087) (fdfdfc8)
Features