Skip to content

fix: write per-locale values from siblingData when req.locale is 'all' for localized fields#16771

Open
deepshekhardas wants to merge 5 commits into
payloadcms:mainfrom
deepshekhardas:fix/16676-locale-all-localized-fields
Open

fix: write per-locale values from siblingData when req.locale is 'all' for localized fields#16771
deepshekhardas wants to merge 5 commits into
payloadcms:mainfrom
deepshekhardas:fix/16676-locale-all-localized-fields

Conversation

@deepshekhardas
Copy link
Copy Markdown
Contributor

Description

When
eq.locale\ is set to 'all', localized fields were not correctly writing per-locale values from \siblingData. This caused the wrong locale values to be persisted when operating in 'all'\ locale mode.

Root Cause

In the \�eforeChange\ hook for fields, when
eq.locale === 'all', the code was reading from \data\ instead of \siblingData\ for per-locale field values. \siblingData\ contains the correct per-locale values that should be written.

Fix

Added a check: when
eq.locale === 'all', read the field value from \siblingData[fieldName]\ instead of falling through to the default \data[fieldName]\ path.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Developer and others added 5 commits May 19, 2026 09:45
The connectWithReconnect function calls pool.connect() to check out a client
but never calls result.release() to return it to the pool. This permanently
holds one connection from the pool, causing pool exhaustion when multiple
concurrent queries are running.

This fix adds result.release() after setting up the error listener to properly
return the connection to the pool.

Fixes: payloadcms#16256 (connection leak part)
…ectWithReconnect

fix(db-postgres): fix connection leak in connectWithReconnect
The SAFE_STRING_REGEX was using \w which only matches ASCII characters,
blocking any non-ASCII characters (CJK, accented Latin, emoji, etc.) in
JSON field queries.

Changed to use \p{L} (Unicode letter) and \p{N} (Unicode number) with
the /u flag, which allows international text while still blocking SQL
metacharacters (' , ; -- ( ) = / \ etc.).

Fixes: payloadcms#16401
fix(drizzle): allow unicode characters in JSON query values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant